From 0e75f256c361402a486c79e57a0323d6c7f92433 Mon Sep 17 00:00:00 2001 From: Maxim Valyanskiy Date: Wed, 28 Sep 2011 08:18:57 +0000 Subject: [PATCH] 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 --- src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.39.5