mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-06 17:13:23 +02:00
Simplify header charset conversion
Thanks @JorgK
This commit is contained in:
@@ -1135,16 +1135,12 @@ public class MessageHelper {
|
||||
return header;
|
||||
|
||||
if (Helper.isUTF8(header)) {
|
||||
if (!Helper.isISO8859(header)) {
|
||||
Log.w("Converting " + name + " to UTF-8");
|
||||
return new String(header.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);
|
||||
}
|
||||
Log.w("Converting " + name + " to UTF-8");
|
||||
return new String(header.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);
|
||||
} else {
|
||||
Log.w("Converting " + name + " to ISO8859-1");
|
||||
Log.i("Converting " + name + " to ISO8859-1");
|
||||
return new String(header.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.ISO_8859_1);
|
||||
}
|
||||
|
||||
return header;
|
||||
}
|
||||
|
||||
private Address[] getAddressHeader(String name) throws MessagingException {
|
||||
|
||||
Reference in New Issue
Block a user