You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ni...@apache.org on 2014/05/08 17:17:22 UTC

svn commit: r1593306 - /poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/datatypes/StringChunk.java

Author: nick
Date: Thu May  8 15:17:22 2014
New Revision: 1593306

URL: http://svn.apache.org/r1593306
Log:
Outlook sometimes stores a codepage of ANSI when it means 1252, detect and alias, fixes bug #53983

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/datatypes/StringChunk.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/datatypes/StringChunk.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/datatypes/StringChunk.java?rev=1593306&r1=1593305&r2=1593306&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/datatypes/StringChunk.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/datatypes/StringChunk.java Thu May  8 15:17:22 2014
@@ -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) {



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