Commit 1496f13d08baa05c7be393938e29f9df7956f8df

Authored by Christian Herdtweck
1 parent 3c15e26a

xls_parser: Minor bugfix and doc addition

Showing 1 changed file with 2 additions and 1 deletions
oletools/xls_parser.py
... ... @@ -101,7 +101,7 @@ def read_unicode(data, start_idx, n_chars):
101 101 """ read a unicode string from a XLUnicodeStringNoCch structure """
102 102 # first bit 0x0 --> only low-bytes are saved, all high bytes are 0
103 103 # first bit 0x1 --> 2 bytes per character
104   - low_bytes_only = (ord(data[start_idx]) == 0)
  104 + low_bytes_only = (ord(data[start_idx:start_idx+1]) == 0)
105 105 if low_bytes_only:
106 106 end_idx = start_idx + 1 + n_chars
107 107 return data[start_idx+1:end_idx].decode('ascii'), end_idx
... ... @@ -349,6 +349,7 @@ class XlsRecordSupBook(XlsRecord):
349 349 LINK_TYPE_EXTERNAL = 'external workbook'
350 350  
351 351 def finish_constructing(self, _):
  352 + """Finish constructing this record; called at end of constructor."""
352 353 # set defaults
353 354 self.ctab = None
354 355 self.cch = None
... ...