mirror of https://github.com/M66B/FairEmail.git
Enable Unicode
This commit is contained in:
parent
a9e452aaab
commit
8c010244e6
|
@ -269,7 +269,7 @@ public class ActivityEML extends ActivityBase {
|
|||
if (is == null)
|
||||
throw new FileNotFoundException(uri.toString());
|
||||
|
||||
Properties props = MessageHelper.getSessionProperties(false);
|
||||
Properties props = MessageHelper.getSessionProperties(true);
|
||||
Session isession = Session.getInstance(props, null);
|
||||
MimeMessage imessage = new MimeMessage(isession, is);
|
||||
|
||||
|
@ -665,7 +665,7 @@ public class ActivityEML extends ActivityBase {
|
|||
if (is == null)
|
||||
throw new FileNotFoundException(uri.toString());
|
||||
|
||||
Properties props = MessageHelper.getSessionProperties(false);
|
||||
Properties props = MessageHelper.getSessionProperties(true);
|
||||
Session isession = Session.getInstance(props, null);
|
||||
MimeMessage imessage = new MimeMessage(isession, is);
|
||||
|
||||
|
|
|
@ -2840,7 +2840,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
for (EntityAttachment attachment : attachments)
|
||||
if (attachment.available && "message/rfc822".equals(attachment.getMimeType()))
|
||||
try (FileInputStream fis = new FileInputStream(attachment.getFile(context))) {
|
||||
Properties props = MessageHelper.getSessionProperties(false);
|
||||
Properties props = MessageHelper.getSessionProperties(true);
|
||||
Session isession = Session.getInstance(props, null);
|
||||
MimeMessage imessage = new MimeMessage(isession, fis);
|
||||
MessageHelper helper = new MessageHelper(imessage, context);
|
||||
|
|
|
@ -330,7 +330,7 @@ public class EntityRule {
|
|||
throw new IllegalArgumentException(context.getString(R.string.title_rule_no_headers));
|
||||
|
||||
ByteArrayInputStream bis = new ByteArrayInputStream(message.headers.getBytes());
|
||||
headers = Collections.list(new InternetHeaders(bis).getAllHeaders());
|
||||
headers = Collections.list(new InternetHeaders(bis, true).getAllHeaders());
|
||||
}
|
||||
|
||||
boolean matches = false;
|
||||
|
|
|
@ -3368,7 +3368,7 @@ public class FragmentCompose extends FragmentBase {
|
|||
}
|
||||
|
||||
// Build message
|
||||
Properties props = MessageHelper.getSessionProperties(false);
|
||||
Properties props = MessageHelper.getSessionProperties(true);
|
||||
Session isession = Session.getInstance(props, null);
|
||||
MimeMessage imessage = new MimeMessage(isession);
|
||||
MessageHelper.build(context, draft, attachments, identity, true, imessage);
|
||||
|
@ -3720,7 +3720,7 @@ public class FragmentCompose extends FragmentBase {
|
|||
}
|
||||
|
||||
// Build message to sign
|
||||
Properties props = MessageHelper.getSessionProperties(false);
|
||||
Properties props = MessageHelper.getSessionProperties(true);
|
||||
Session isession = Session.getInstance(props, null);
|
||||
MimeMessage imessage = new MimeMessage(isession);
|
||||
MessageHelper.build(context, draft, attachments, identity, true, imessage);
|
||||
|
@ -6405,7 +6405,7 @@ public class FragmentCompose extends FragmentBase {
|
|||
// Check size
|
||||
if (identity != null && identity.max_size != null)
|
||||
try {
|
||||
Properties props = MessageHelper.getSessionProperties(false);
|
||||
Properties props = MessageHelper.getSessionProperties(true);
|
||||
if (identity.unicode)
|
||||
props.put("mail.mime.allowutf8", "true");
|
||||
Session isession = Session.getInstance(props, null);
|
||||
|
|
|
@ -1270,7 +1270,7 @@ public class FragmentFolders extends FragmentBase {
|
|||
String PATTERN_ASCTIME = "EEE MMM d HH:mm:ss yyyy";
|
||||
SimpleDateFormat df = new SimpleDateFormat(PATTERN_ASCTIME, Locale.US);
|
||||
|
||||
Properties props = MessageHelper.getSessionProperties(false);
|
||||
Properties props = MessageHelper.getSessionProperties(true);
|
||||
Session isession = Session.getInstance(props, null);
|
||||
|
||||
// https://www.ietf.org/rfc/rfc4155.txt (Appendix A)
|
||||
|
|
|
@ -8115,7 +8115,7 @@ public class FragmentMessages extends FragmentBase
|
|||
} else {
|
||||
// Decode message
|
||||
MessageHelper.MessageParts parts;
|
||||
Properties props = MessageHelper.getSessionProperties(false);
|
||||
Properties props = MessageHelper.getSessionProperties(true);
|
||||
Session isession = Session.getInstance(props, null);
|
||||
MimeMessage imessage;
|
||||
try (InputStream fis = new FileInputStream(plain)) {
|
||||
|
@ -8814,7 +8814,7 @@ public class FragmentMessages extends FragmentBase
|
|||
boolean duplicate = args.getBoolean("duplicate");
|
||||
|
||||
// Decode message
|
||||
Properties props = MessageHelper.getSessionProperties(false);
|
||||
Properties props = MessageHelper.getSessionProperties(true);
|
||||
Session isession = Session.getInstance(props, null);
|
||||
MimeMessage imessage = new MimeMessage(isession, is);
|
||||
MessageHelper helper = new MessageHelper(imessage, context);
|
||||
|
@ -8927,7 +8927,7 @@ public class FragmentMessages extends FragmentBase
|
|||
for (EntityAttachment remote : remotes)
|
||||
if ("message/rfc822".equals(remote.getMimeType()))
|
||||
try {
|
||||
Properties props = MessageHelper.getSessionProperties(false);
|
||||
Properties props = MessageHelper.getSessionProperties(true);
|
||||
Session isession = Session.getInstance(props, null);
|
||||
|
||||
MimeMessage imessage;
|
||||
|
|
|
@ -2783,7 +2783,7 @@ public class HtmlHelper {
|
|||
|
||||
MailDateFormat mdf = new MailDateFormat();
|
||||
ByteArrayInputStream bis = new ByteArrayInputStream(headers.getBytes());
|
||||
InternetHeaders iheaders = new InternetHeaders(bis);
|
||||
InternetHeaders iheaders = new InternetHeaders(bis, true);
|
||||
|
||||
String dh = iheaders.getHeader("Date", null);
|
||||
Date tx = null;
|
||||
|
|
|
@ -1364,10 +1364,10 @@ public class MessageHelper {
|
|||
getMessageParts(null, imessage, parts, null);
|
||||
for (AttachmentPart apart : parts.attachments)
|
||||
if ("text/rfc822-headers".equalsIgnoreCase(apart.attachment.type)) {
|
||||
reportHeaders = new InternetHeaders(apart.part.getInputStream());
|
||||
reportHeaders = new InternetHeaders(apart.part.getInputStream(), true);
|
||||
break;
|
||||
} else if ("message/rfc822".equalsIgnoreCase(apart.attachment.type)) {
|
||||
Properties props = MessageHelper.getSessionProperties(false);
|
||||
Properties props = MessageHelper.getSessionProperties(true);
|
||||
Session isession = Session.getInstance(props, null);
|
||||
MimeMessage amessage = new MimeMessage(isession, apart.part.getInputStream());
|
||||
reportHeaders = amessage.getHeaders();
|
||||
|
@ -3623,7 +3623,7 @@ public class MessageHelper {
|
|||
|
||||
if ("message/rfc822".equals(local.type))
|
||||
try (FileInputStream fis = new FileInputStream(local.getFile(context))) {
|
||||
Properties props = MessageHelper.getSessionProperties(false);
|
||||
Properties props = MessageHelper.getSessionProperties(true);
|
||||
Session isession = Session.getInstance(props, null);
|
||||
MimeMessage imessage = new MimeMessage(isession, fis);
|
||||
MessageHelper helper = new MessageHelper(imessage, context);
|
||||
|
@ -4544,7 +4544,7 @@ public class MessageHelper {
|
|||
if (bis.available() == 0)
|
||||
throw new IOException("NIL");
|
||||
|
||||
Properties props = MessageHelper.getSessionProperties(false);
|
||||
Properties props = MessageHelper.getSessionProperties(true);
|
||||
Session isession = Session.getInstance(props, null);
|
||||
|
||||
Log.w("Decoding raw message");
|
||||
|
@ -4834,7 +4834,7 @@ public class MessageHelper {
|
|||
content = content.replaceAll("(\\r?\\n)+", "\n");
|
||||
ByteArrayInputStream bis = new ByteArrayInputStream(content.getBytes());
|
||||
try {
|
||||
Enumeration<Header> headers = new InternetHeaders(bis).getAllHeaders();
|
||||
Enumeration<Header> headers = new InternetHeaders(bis, true).getAllHeaders();
|
||||
while (headers.hasMoreElements()) {
|
||||
Header header = headers.nextElement();
|
||||
String name = header.getName();
|
||||
|
|
Loading…
Reference in New Issue