From: Maxim Valyanskiy Date: Wed, 28 Sep 2011 08:18:57 +0000 (+0000) Subject: bug#51901: StringChunk.parseAs7BitData - Encoding not found - US-ASCII; format=flowed X-Git-Tag: REL_3_8_BETA5~123 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0e75f256c361402a486c79e57a0323d6c7f92433;p=poi.git bug#51901: StringChunk.parseAs7BitData - Encoding not found - US-ASCII; format=flowed git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1176780 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java b/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java index 1f31c086c5..0cc31b91af 100644 --- a/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java +++ b/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java @@ -363,7 +363,8 @@ public class MAPIMessage extends POIDocument { String[] headers = getHeaders(); if(headers != null && headers.length > 0) { // Look for a content type with a charset - Pattern p = Pattern.compile("Content-Type:.*?charset=[\"']?(.*?)[\"']?"); + Pattern p = Pattern.compile("Content-Type:.*?charset=[\"']?([^;'\"]+)[\"']?", Pattern.CASE_INSENSITIVE); + for(String header : headers) { if(header.startsWith("Content-Type")) { Matcher m = p.matcher(header);