|
|
@ -146,10 +146,10 @@ public class text_plain extends handler_base {
|
|
|
|
String charset = ct.getParameter("charset");
|
|
|
|
String charset = ct.getParameter("charset");
|
|
|
|
if (charset == null)
|
|
|
|
if (charset == null)
|
|
|
|
// If the charset parameter is absent, use US-ASCII.
|
|
|
|
// If the charset parameter is absent, use US-ASCII.
|
|
|
|
if ("text/html".equalsIgnoreCase(ct.getBaseType()))
|
|
|
|
charset = "us-ascii";
|
|
|
|
|
|
|
|
if ("us-ascii".equals(charset) &&
|
|
|
|
|
|
|
|
"text/html".equalsIgnoreCase(ct.getBaseType()))
|
|
|
|
charset = StandardCharsets.UTF_8.name();
|
|
|
|
charset = StandardCharsets.UTF_8.name();
|
|
|
|
else
|
|
|
|
|
|
|
|
charset = "us-ascii";
|
|
|
|
|
|
|
|
return MimeUtility.javaCharset(charset);
|
|
|
|
return MimeUtility.javaCharset(charset);
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|