mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-02 07:06:18 +02:00
Fixed incorrect transform from UTF-16 to US-ASCII
This commit is contained in:
@@ -3229,10 +3229,10 @@ public class MessageHelper {
|
||||
try {
|
||||
if (CHARSET16.contains(cs)) {
|
||||
Charset detected = CharsetHelper.detect(result, cs);
|
||||
// UTF-16 can be detected as US-ASCII
|
||||
if (!CHARSET16.contains(detected))
|
||||
Log.w(new Throwable("Charset=" + cs + " detected=" + detected));
|
||||
if (StandardCharsets.US_ASCII.equals(detected) ||
|
||||
StandardCharsets.UTF_8.equals(detected)) {
|
||||
if (StandardCharsets.UTF_8.equals(detected)) {
|
||||
charset = null;
|
||||
result = new String(result.getBytes(cs), detected);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user