mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-13 14:48:04 -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.
|
* 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)
|
if (charset == null)
|
||||||
{
|
{
|
||||||
@ -592,4 +593,19 @@ public class MimeUtility
|
|||||||
}
|
}
|
||||||
return DEFAULT_ATTACHMENT_MIME_TYPE;
|
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