Unicode characters, XML/RSS

Stefan Behnel stefan_ml at behnel.de
Thu Jul 31 01:59:28 EDT 2008


Adam W. wrote:
>   File "C:\Python25\lib\xml\sax\expatreader.py", line 207, in feed
>     self._parser.Parse(data, isFinal)
>   File "C:\Users\Adam\Desktop\Rev3 DL\XMLWorkspace.py", line 51, in
> characters
>     self.data.append(string)
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xe8' in
> position 236: ordinal not in range(128)

You seem to be doing an implicit conversion from a unicode string to a byte
string, maybe by concatenating ('+' operator) strings of different types or by
writing it out into a file (or printing it, or ...) - I don't know what
self.data is or does, since you didn't provide any code.

Stefan



More information about the Python-list mailing list