[XML-SIG] Experimental Unicode/Python
Mon, 30 Mar 1998 15:27:14 -0500 (EST)
[Follow-ups set to firstname.lastname@example.org]
Earlier today I told the String-SIG about an experimental version of
Python that's been modified to support Unicode strings. I won't
repeat that announcement here; consult the String-SIG archives for the
The code is in /pub/tmp/ on ftp.python.org.
The experimental interpreter has a new built-in function, unicode(),
that takes a regular string and returns a wide string object
containing it. Wide strings and regular 8-bit strings are mostly
interchangeable in Python code. C extensions that use
PyArg_ParseTuple("s") will attempt to collapse a wide string down to 8
bits, raising an exception if it can't be done because of characters
>255. So code like this will work:
filename = unicode('/tmp/py-unicode')
f = open(filename, 'w')
stropmodule and pcremodule haven't yet been modified to
support wide strings; string.py has been changed to not use strop, but
no such simple fix is possible for re. We'll worry about those for
later releases of the code.
So, please experiment with this hacked interpreter, and send
bug reports and API shortcomings to the String-SIG.
A.M. Kuchling http://starship.skyport.net/crew/amk/
I am afraid of the worst, but I am not sure what that is.
-- Abraham Rotstein