unicode and data strings
Laszlo Zsolt Nagy
gandalf at geochemsource.com
Fri Jan 28 04:20:01 EST 2005
Hello
I have a program where I would like to calculate a checksum. Looks like
this:
n = self.__calc_n(seed1,seed2,pwd)
This is required for an OTP (One Time Password) algorithm. My code was
working before without problems.
Now I installed Python 2.3.4 and wxPython 2.5.3 (with unicode support).
I'm getting this exception:
exceptions.UnicodeDecodeError:'ascii' codec can't decode byte 0x91 in
position 0: ordinal not in range(128)
The I tried this:
>>>'\x91'.decode('utf8')
UnicodeDecodeError: 'utf8' codec can't decode byte 0x91 in position 0:
unexpected code byte
Here is the question: I would like to use simple binary data strings
(like an array of bytes).
I do not care about encodings. How do I do that?
Thanks,
Laci 2.0
More information about the Python-list
mailing list