codec to parse raw UCS data?

Oleg Leschov kalmas at udm.ru
Tue Aug 19 20:12:03 EDT 2003


Where can I find a list and documentation for codecs?
What I want to do is to make a unicode string out of unicode data.
for example. I am parsing NTFS metadata, that contains filenames as
UCS-2 code, so I have a binary string that pretends to be a UCS-2.
Currently I am using hand-written module, a wrapper to iconv library, to make 
translation of this data (that is, I used it for that task).
However, I am aware of python's codecs that are supposed to do the same 
thing in much prettier way.. So, as long as I can do things like
st = u'\uxxxx' and such, I could construct and exec it, but this is ugly...
Shouldn't there be a simple thing like <bin.string>.decode("UCS-2")
that would return a python's unicode string?
Or perhaps I've missed something in the documentation...






More information about the Python-list mailing list