diff options
author | Walter Dörwald <walter@livinglogic.de> | 2006-11-23 05:03:56 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2006-11-23 05:03:56 (GMT) |
commit | 39b8b6afb52d3e1a0e52cd8f15f6b0d3210e5d6e (patch) | |
tree | bace5769566b46dd9d099f4592d944a696005fd6 /Lib/encodings | |
parent | 4ebbefe677f47a8e4f624737338f22e714a7e5bc (diff) | |
download | cpython-39b8b6afb52d3e1a0e52cd8f15f6b0d3210e5d6e.zip cpython-39b8b6afb52d3e1a0e52cd8f15f6b0d3210e5d6e.tar.gz cpython-39b8b6afb52d3e1a0e52cd8f15f6b0d3210e5d6e.tar.bz2 |
Change decode() so that it works with a buffer (i.e. unicode(..., 'utf-8-sig'))
SF bug #1601501.
Diffstat (limited to 'Lib/encodings')
-rw-r--r-- | Lib/encodings/utf_8_sig.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/encodings/utf_8_sig.py b/Lib/encodings/utf_8_sig.py index f05f6b8..d751da6 100644 --- a/Lib/encodings/utf_8_sig.py +++ b/Lib/encodings/utf_8_sig.py @@ -16,7 +16,7 @@ def encode(input, errors='strict'): def decode(input, errors='strict'): prefix = 0 - if input.startswith(codecs.BOM_UTF8): + if input[:3] == codecs.BOM_UTF8: input = input[3:] prefix = 3 (output, consumed) = codecs.utf_8_decode(input, errors, True) |