]> source.dussan.org Git - poi.git/commitdiff
bug#51901: StringChunk.parseAs7BitData - Encoding not found - US-ASCII; format=flowed
authorMaxim Valyanskiy <maxcom@apache.org>
Wed, 28 Sep 2011 08:18:57 +0000 (08:18 +0000)
committerMaxim Valyanskiy <maxcom@apache.org>
Wed, 28 Sep 2011 08:18:57 +0000 (08:18 +0000)
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

index 1f31c086c5ed9bb5da2294cd648364375c44ba62..0cc31b91afbd9169dd5fc934fddffd0d9e633d2f 100644 (file)
@@ -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);