Fredrik Lundh <[email protected]> added the comment:
Converting from UTF-8 to Unicode is the right thing to do, but
converting back to Latin-1 is not correct -- note that ET returns a
Unicode string, not an 8-bit string. There's a "makestring" helper that
does the right thing in the library; just changing:
parcel = Py_BuildValue("ss", (prefix) ? prefix : "", uri);
to
parcel = Py_BuildValue("sN", (prefix) ? prefix : "", makestring(uri));
should work (even if you should probably do that in two steps, and look
for errors from makestring before proceeding).
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue6266>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com