]> source.dussan.org Git - poi.git/commitdiff
Outlook sometimes stores a codepage of ANSI when it means 1252, detect and alias...
authorNick Burch <nick@apache.org>
Thu, 8 May 2014 15:17:22 +0000 (15:17 +0000)
committerNick Burch <nick@apache.org>
Thu, 8 May 2014 15:17:22 +0000 (15:17 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1593306 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hsmf/datatypes/StringChunk.java

index 1b856890e954ff6e7d41c5c33b5aee1486ef4d5a..25b0bcec2d8dd9fb0566d1983052bfc037f344c4 100644 (file)
@@ -143,6 +143,12 @@ public class StringChunk extends Chunk {
     *  and returns the string that that yields.
     */
    protected static String parseAs7BitData(byte[] data, String encoding) {
+      // Handle any encoding aliases, where outlook describes it differently
+      if ("ansi".equals(encoding)) {
+          encoding = DEFAULT_ENCODING;
+      }
+      
+      // Decode
       try {
          return new String(data, encoding);
       } catch (UnsupportedEncodingException e) {