mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Issue #28541: Improve test coverage for encoding detection in json library.
Original patch by Eric Appelt.
This commit is contained in:
parent
a0d9c685d0
commit
c4a35daa97
2 changed files with 15 additions and 1 deletions
|
@ -257,7 +257,8 @@ def detect_encoding(b):
|
|||
return 'utf-16-be' if b[1] else 'utf-32-be'
|
||||
if not b[1]:
|
||||
# XX 00 00 00 - utf-32-le
|
||||
# XX 00 XX XX - utf-16-le
|
||||
# XX 00 00 XX - utf-16-le
|
||||
# XX 00 XX -- - utf-16-le
|
||||
return 'utf-16-le' if b[2] or b[3] else 'utf-32-le'
|
||||
elif len(b) == 2:
|
||||
if not b[0]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue