It has been a long day and I am a little puzzled.
I am reading a binary containing many char strings and I want to unload them as Python Unicode strings. (To unzip non-string data, I use the struct module, but I do not do the same with strings.)
For example, after reading the word "Series":
myfile = open("test.lei", "rb") myfile.seek(44) data = myfile.read(12) # data is now 'S\x00e\x00r\x00i\x00e\x00s\x00'
How can I encode raw wide-char data as a Python string?
Edit: I am using Python 2.6
source share