i have a strange issue:
Code: Select all
>>> struct.unpack('>B', '\x7f')[0]
127
>>> struct.unpack('>B', '\x80')[0]
194
thanks!
Oli
Code: Select all
>>> struct.unpack('>B', '\x7f')[0]
127
>>> struct.unpack('>B', '\x80')[0]
194
Code: Select all
>>> import ustruct as struct
>>> struct.unpack('>B', b'\x80')[0]
128
>>>
Code: Select all
>>> import struct
>>> struct.unpack('>B', '\x7f')[0]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'str' does not support the buffer interface
>>>