poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1651517 - in /poi/trunk/src: java/org/apache/poi/hssf/record/OldStringRecord.java java/org/apache/poi/util/CodePageUtil.java testcases/org/apache/poi/hssf/extractor/TestOldExcelExtractor.java
Date Tue, 13 Jan 2015 22:13:24 GMT
Author: nick
Date: Tue Jan 13 22:13:24 2015
New Revision: 1651517

URL: http://svn.apache.org/r1651517
Log:
Fix TIKA-1515 - Handle Excel 3 files with a 0x8001 codepage

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/record/OldStringRecord.java
    poi/trunk/src/java/org/apache/poi/util/CodePageUtil.java
    poi/trunk/src/testcases/org/apache/poi/hssf/extractor/TestOldExcelExtractor.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/OldStringRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/OldStringRecord.java?rev=1651517&r1=1651516&r2=1651517&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/OldStringRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/OldStringRecord.java Tue Jan 13 22:13:24
2015
@@ -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);

Modified: poi/trunk/src/java/org/apache/poi/util/CodePageUtil.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/util/CodePageUtil.java?rev=1651517&r1=1651516&r2=1651517&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/util/CodePageUtil.java (original)
+++ poi/trunk/src/java/org/apache/poi/util/CodePageUtil.java Tue Jan 13 22:13:24 2015
@@ -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";

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/extractor/TestOldExcelExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/extractor/TestOldExcelExtractor.java?rev=1651517&r1=1651516&r2=1651517&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/extractor/TestOldExcelExtractor.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/extractor/TestOldExcelExtractor.java Tue Jan
13 22:13:24 2015
@@ -38,7 +38,7 @@ public final class TestOldExcelExtractor
         }
     }
     
-    public void DISABLEDtestSimpleExcel3() {
+    public void testSimpleExcel3() {
         OldExcelExtractor extractor = createExtractor("testEXCEL_3.xls");
 
         // Check we can call getText without error



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message