diff options
-rw-r--r-- | src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java | 3 |
1 files changed, 2 insertions, 1 deletions
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); |