unicode confusion

Achim Domma achim.domma at syynx.de
Mon Feb 10 08:01:55 EST 2003


Hi,

I have still problems handling pythonstrings with unicode. Reading and
writing files with the codecs module is no problem, but now I have a new
problem: Using win32com I get a unicode string from a COM object. As far as
I understand, the string should be ucs16 if it comes from COM. But is there
a way to check this? Is there at all a way to get the encoding of a string,
or at least to gues?
Assuming it is ucs16 encoded, how to convert it to utf-8?
data.encode('utf-8') does not raises an error but the returned text is
broken.

regards,
Achim






More information about the Python-list mailing list