diff options
| author | Герасименко Евгений <evgen23@gmail.com> | 2016-12-29 10:17:59 +0700 |
|---|---|---|
| committer | Герасименко Евгений <evgen23@gmail.com> | 2016-12-29 10:21:32 +0700 |
| commit | 1c34ac3ae66ef05820d781bde7ae8eda673eaa46 (patch) | |
| tree | 21f32496119bd82a4a79701e10d04ef1d857b27c /requests/utils.py | |
| parent | 8e0a532cad39e28dc6e74002f79513dbb509bad2 (diff) | |
| download | python-requests-1c34ac3ae66ef05820d781bde7ae8eda673eaa46.tar.gz | |
Fixed detection of utf-32-be by BOM.
Diffstat (limited to 'requests/utils.py')
| -rw-r--r-- | requests/utils.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/requests/utils.py b/requests/utils.py index 4def3dba..47325090 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -714,7 +714,7 @@ def guess_json_utf(data): # easy as counting the nulls and from their location and count # determine the encoding. Also detect a BOM, if present. sample = data[:4] - if sample in (codecs.BOM_UTF32_LE, codecs.BOM32_BE): + if sample in (codecs.BOM_UTF32_LE, codecs.BOM_UTF32_BE): return 'utf-32' # BOM included if sample[:3] == codecs.BOM_UTF8: return 'utf-8-sig' # BOM included, MS style (discouraged) |
