[Python-bugs-list] [ python-Bugs-502255 ] leading '\xff\xfe' w/ s.encode('utf-16')
noreply@sourceforge.net
noreply@sourceforge.net
Fri, 11 Jan 2002 02:42:22 -0800
Bugs item #502255, was opened at 2002-01-11 02:19
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=502255&group_id=5470
Category: Unicode
Group: Python 2.1.1
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Niels Mache (nielsmache)
Assigned to: M.-A. Lemburg (lemburg)
Summary: leading '\xff\xfe' w/ s.encode('utf-16')
Initial Comment:
The UTF-16 encode method returns '\xff\xfe' at the start of the result string:
>>> s = ''
>>> s.encode('utf-16')
'\xff\xfe'
----------------------------------------------------------------------
>Comment By: M.-A. Lemburg (lemburg)
Date: 2002-01-11 02:42
Message:
Logged In: YES
user_id=38388
That's not a bug. Use 'utf-16-le' or 'utf-16-be' if you want to avoid the BOM mark.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=502255&group_id=5470