mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-26 01:28:50 -05:00
Add a hook for hinting charset conversions to Java, since Android's java
doesn't know about all conversions.
This commit is contained in:
parent
9871f1be53
commit
d123aa2a39
@ -374,7 +374,8 @@ public class MimeUtility
|
||||
/*
|
||||
* See if there is conversion from the MIME charset to the Java one.
|
||||
*/
|
||||
charset = Charset.forName(originalCharset).name();
|
||||
|
||||
charset = Charset.forName(fixupCharset(originalCharset)).name();
|
||||
|
||||
if (charset == null)
|
||||
{
|
||||
@ -592,4 +593,19 @@ public class MimeUtility
|
||||
}
|
||||
return DEFAULT_ATTACHMENT_MIME_TYPE;
|
||||
}
|
||||
|
||||
|
||||
private static String fixupCharset(String charset)
|
||||
{
|
||||
charset = charset.toLowerCase();
|
||||
if (charset.equals("cp932"))
|
||||
return "shift-jis";
|
||||
else if (charset.equals("koi8-u"))
|
||||
return "koi8-r";
|
||||
|
||||
return charset;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user