diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-17 15:10:57 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-17 15:10:57 +0200 |
commit | 4cf732e24a768f161abded0a1caf5fd73185e293 (patch) | |
tree | d521f4adbdb55e97b4b992c8b5c100ac3066207f /msodumper/msometa.py | |
parent | 118fb2945bda2c626cc1391fc4e1eb87d872d24b (diff) |
msometa: handle latin2 encoding
Diffstat (limited to 'msodumper/msometa.py')
-rw-r--r-- | msodumper/msometa.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/msodumper/msometa.py b/msodumper/msometa.py index 5ee0228..2afd8fa 100644 --- a/msodumper/msometa.py +++ b/msodumper/msometa.py @@ -275,12 +275,14 @@ class CodePageString(DOCDirStream): break bytes.append(c) codepage = self.parent.parent.getCodePage() - if codepage < 0: + if (codepage is not None) and (codepage < 0): codepage += 2 ** 16 # signed -> unsigned encoding = "" + # http://msdn.microsoft.com/en-us/goglobal/bb964654 if codepage == 1252: - # http://msdn.microsoft.com/en-us/goglobal/bb964654 encoding = "latin1" + elif codepage == 1250: + encoding = "latin2" elif codepage == 65001: # http://msdn.microsoft.com/en-us/library/windows/desktop/dd374130%28v=vs.85%29.aspx encoding = "utf-8" |