mirror of https://github.com/M66B/FairEmail.git
replace "ISO-8859-1" with StandardCharsets
This commit is contained in:
parent
3285867499
commit
72dcc50ea1
|
@ -34,6 +34,7 @@ import java.io.InputStream;
|
|||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Enumeration;
|
||||
|
@ -624,13 +625,10 @@ public class MessageHelper {
|
|||
if (TextUtils.isEmpty(charset)) {
|
||||
if (BuildConfig.DEBUG)
|
||||
warnings.add(context.getString(R.string.title_no_charset, ct.toString()));
|
||||
if (part.isMimeType("text/plain"))
|
||||
try {
|
||||
// The first 127 characters are the same as in US-ASCII
|
||||
result = new String(result.getBytes("ISO-8859-1"));
|
||||
} catch (UnsupportedEncodingException ex) {
|
||||
warnings.add(Helper.formatThrowable(ex));
|
||||
}
|
||||
if (part.isMimeType("text/plain")) {
|
||||
// The first 127 characters are the same as in US-ASCII
|
||||
result = new String(result.getBytes(StandardCharsets.ISO_8859_1));
|
||||
}
|
||||
} else {
|
||||
if ("US-ASCII".equals(Charset.forName(charset).name()) &&
|
||||
!"US-ASCII".equals(charset.toUpperCase()))
|
||||
|
|
Loading…
Reference in New Issue