[New-bugs-announce] [issue33143] encode UTF-16 generates unexpected results

Anders Rundgren report at bugs.python.org
Mon Mar 26 05:26:20 EDT 2018


New submission from Anders Rundgren <anders.rundgren.net at gmail.com>:

Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> v = '\u20ac'
>>> print (v)
€
>>> v.encode('utf-16')
b'\xff\xfe\xac '
>>> v.encode('utf-16_be')
b' \xac'

I had expected to get pair of bytes with 20 AC for the € symbol

----------
components: Unicode
messages: 314443
nosy: anders.rundgren.net at gmail.com, ezio.melotti, vstinner
priority: normal
severity: normal
status: open
title: encode UTF-16 generates unexpected results
type: behavior
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33143>
_______________________________________


More information about the New-bugs-announce mailing list