[issue10783] struct.pack() and Unicode strings

David Beazley report at bugs.python.org
Mon Dec 27 21:09:56 CET 2010


New submission from David Beazley <dave at dabeaz.com>:

Is the struct.pack() function supposed to automatically encode Unicode strings into binary?  For example:

>>> struct.pack("10s","Jalape\u00f1o")
b'Jalape\xc3\xb1o\x00'
>>>

This is Python 3.2b1.

----------
components: Library (Lib)
messages: 124727
nosy: dabeaz
priority: normal
severity: normal
status: open
title: struct.pack() and Unicode strings
type: behavior
versions: Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10783>
_______________________________________


More information about the Python-bugs-list mailing list