diff options
author | Nick Burch <nick@apache.org> | 2015-01-13 22:13:24 +0000 |
---|---|---|
committer | Nick Burch <nick@apache.org> | 2015-01-13 22:13:24 +0000 |
commit | 631fc8f9bca1bad6f4135628f7d39d74f34c1f8e (patch) | |
tree | c3a8c4b2b5b8743859b6b206da9ff820a9924d17 /src/java | |
parent | ffe2581d6d6fb56659ad97ea7e9a813203bfb9af (diff) | |
download | poi-631fc8f9bca1bad6f4135628f7d39d74f34c1f8e.tar.gz poi-631fc8f9bca1bad6f4135628f7d39d74f34c1f8e.zip |
Fix TIKA-1515 - Handle Excel 3 files with a 0x8001 codepage
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1651517 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/org/apache/poi/hssf/record/OldStringRecord.java | 2 | ||||
-rw-r--r-- | src/java/org/apache/poi/util/CodePageUtil.java | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/java/org/apache/poi/hssf/record/OldStringRecord.java b/src/java/org/apache/poi/hssf/record/OldStringRecord.java index 0a5b492238..4964f84803 100644 --- a/src/java/org/apache/poi/hssf/record/OldStringRecord.java +++ b/src/java/org/apache/poi/hssf/record/OldStringRecord.java @@ -75,7 +75,7 @@ public final class OldStringRecord { protected static String getString(byte[] data, CodepageRecord codepage) { int cp = CodePageUtil.CP_ISO_8859_1; if (codepage != null) { - cp = codepage.getCodepage(); + cp = codepage.getCodepage() & 0xffff; } try { return CodePageUtil.getStringFromCodePage(data, cp); diff --git a/src/java/org/apache/poi/util/CodePageUtil.java b/src/java/org/apache/poi/util/CodePageUtil.java index 02e0ed3c0c..145929182a 100644 --- a/src/java/org/apache/poi/util/CodePageUtil.java +++ b/src/java/org/apache/poi/util/CodePageUtil.java @@ -53,6 +53,7 @@ public class CodePageUtil /** <p>Codepage for Windows 1252</p> */ public static final int CP_WINDOWS_1252 = 1252; + public static final int CP_WINDOWS_1252_BIFF23 = 32769; /** <p>Codepage for Windows 1253</p> */ public static final int CP_WINDOWS_1253 = 1253; @@ -77,6 +78,7 @@ public class CodePageUtil /** <p>Codepage for Macintosh Roman (Java: MacRoman)</p> */ public static final int CP_MAC_ROMAN = 10000; + public static final int CP_MAC_ROMAN_BIFF23 = 32768; /** <p>Codepage for Macintosh Japan (Java: unknown - use SJIS, cp942 or * cp943)</p> */ @@ -298,6 +300,7 @@ public class CodePageUtil else return "windows-1251"; case CP_WINDOWS_1252: + case CP_WINDOWS_1252_BIFF23: if (javaLangFormat) return "Cp1252"; else @@ -335,6 +338,7 @@ public class CodePageUtil case CP_JOHAB: return "johab"; case CP_MAC_ROMAN: + case CP_MAC_ROMAN_BIFF23: return "MacRoman"; case CP_MAC_JAPAN: return "SJIS"; |