diff options
author | Walter Dörwald <walter@livinglogic.de> | 2006-11-23 05:06:31 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2006-11-23 05:06:31 (GMT) |
commit | 9ff1d394027c1ae08d15df149bb1ee5a62f566de (patch) | |
tree | 6d96978cdb6e7bda8064fc67faf14d1489f882c9 /Lib/encodings | |
parent | 2396f4c3b1b54a7749d4fa7a6cabac389bff6a21 (diff) | |
download | cpython-9ff1d394027c1ae08d15df149bb1ee5a62f566de.zip cpython-9ff1d394027c1ae08d15df149bb1ee5a62f566de.tar.gz cpython-9ff1d394027c1ae08d15df149bb1ee5a62f566de.tar.bz2 |
Backport checkin:
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) |