also support get for unicode string arrays
This commit is contained in:
parent
a0ffd9f434
commit
d723e126bf
1 changed files with 13 additions and 1 deletions
|
|
@ -770,7 +770,11 @@ class RawHeader(object):
|
|||
# unicode string array
|
||||
for i in range(count):
|
||||
end = self.header.find(six.b('\0'), pos)
|
||||
print("i18n(%d): %r" % (end - pos, self.header[pos:end]))
|
||||
try:
|
||||
print("i18n(%d): %r" % (end - pos, _decode_item(self.header[pos:end])))
|
||||
except Exception:
|
||||
print('INVALID STRING')
|
||||
print("i18n(%d): %r" % (end - pos, self.header[pos:end]))
|
||||
pos = end + 1
|
||||
next = pos
|
||||
else:
|
||||
|
|
@ -815,6 +819,14 @@ class RawHeader(object):
|
|||
result.append(self.header[pos:end])
|
||||
pos = end + 1
|
||||
return result
|
||||
elif dtype == 9:
|
||||
# unicode string array
|
||||
result = []
|
||||
for i in range(count):
|
||||
end = self.header.find(six.b('\0'), pos)
|
||||
result.append(_decode_item(self.header[pos:end]))
|
||||
pos = end + 1
|
||||
return result
|
||||
else:
|
||||
# XXX - not all valid data types are handled
|
||||
raise GenericError("Unable to read header data type: %x" % dtype)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue