From eb5866370a0020fb3d7df765803babf9b3da5c13 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Thu, 8 May 2014 15:17:22 +0000 Subject: [PATCH] Outlook sometimes stores a codepage of ANSI when it means 1252, detect and alias, fixes bug #53983 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1593306 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/org/apache/poi/hsmf/datatypes/StringChunk.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/StringChunk.java b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/StringChunk.java index 1b856890e9..25b0bcec2d 100644 --- a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/StringChunk.java +++ b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/StringChunk.java @@ -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) { -- 2.39.5