poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1593306 - /poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/datatypes/StringChunk.java
Date Thu, 08 May 2014 15:17:22 GMT
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


Mime
View raw message