BUG? Python 2.0 chokes on international characters in Unicode strings

Jurie Horneman jhorSPAMBGONneman at wanadoo.fr
Sun Jan 28 02:49:53 EST 2001


I've checked the FAQ and the buglist, but I couldn't find anything on this.

I was doing some COM programming with Python 2.0 on Windows 2000 yesterday.
I retrieved some Unicode strings containing international characters: e
accent grave, c accent circonflex, that kind of thing (I live in France).
Printing these strings raised a Unicode exception. Some investigation showed
that the exception was raised when trying to print the international
characters. Replacing them by some dummy character "solved" the problem: the
strings printed fine.

It's odd: I've seen French COM error messages printed by Python. The
international characters were not printed correctly ('u/351'), but at least
it didn't crash...

I haven't verified if the same thing happens with ASCII strings.

Is this a known bug? (If so, AAARRGGHHH - could it really be that Python
basically doesn't work outside of the US? Hard to believe: these characters
are used in the Dutch language...)
Is there some workaround? Could I convert Unicode strings to ASCII? If so,
how?

Thanks for any help on this. Please put my work address
jhorneman at kalisto.com in copy if you can, I'm writing this from home.

--
Jurie Horneman
Opinions expressed are my own
jhorSPAMBGONneman at wanadoo.fr






More information about the Python-list mailing list