Small improvement

pull/172/head 1.934
M66B 5 years ago
parent b0ecc85dda
commit fd497698ab

@ -45,6 +45,7 @@ import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.nio.charset.IllegalCharsetNameException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -1259,7 +1260,14 @@ public class MessageHelper {
charset = charset.replace("\"", ""); charset = charset.replace("\"", "");
charset = MimeUtility.javaCharset(charset); charset = MimeUtility.javaCharset(charset);
if (!Charset.isSupported(charset)) { boolean supported = false;
try {
supported = Charset.isSupported(charset);
} catch (IllegalCharsetNameException ex) {
Log.e(charset, ex);
}
if (!supported) {
// x-binaryenc // x-binaryenc
// UseInqueCodePage // UseInqueCodePage
// none // none

Loading…
Cancel
Save