Problems with unicode

James Laamnna jamesl at appliedminds.com
Sat Mar 13 16:45:06 EST 2004


I'm trying to write out a XML document using a StringIO class, however
I always run into the following error:

UnicodeDecodeError: 'ascii' codec can't decode byte 0x92 in position
4: ordinal
not in range(128)

Apparently in the batch that I'm encoding there is one string with
non-ascii characters in it.
Is there any way to just have it encode everything as unicode and not
ascii?
Or should I just strip out non-ascii characters (a last resort which I
do not want to do)
Thanks.



More information about the Python-list mailing list