The UTF-8 byte order mark (=EF=BB=BF) is appended to the HTML part when converting / saving a mail message to EML format (5.8.0). This was not the case when using version 5.3.0 of Aspose Email.
Is the observed behavior really the expected one? Is there a way to omit the BOM?
Code to reproduce:
String eml = “”
+ “MIME-Version: 1.0\n”
+ “Content-Type: text/html; charset=“utf-8”\n”
+ “Content-Transfer-Encoding: quoted-printable\n”
// same result when using new EmlLoadOptions() instead of MailMessageLoadOptions.getDefaultEml()
MailMessage mailMessage = MailMessage.load(new ByteArrayInputStream(eml.getBytes(StandardCharsets.UTF_8)), MailMessageLoadOptions.getDefaultEml());
ByteArrayOutputStream bos = new ByteArrayOutputStream();
System.out.println(new String(bos.toByteArray(), StandardCharsets.UTF_8));
// last line of output
// 5.8.0: =EF=BB=BFHi
// 5.3.0: Hi
Thanks in advance.
The issues you have found earlier (filed as EMAILJAVA-33550) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
Great, thanks for the fix.
I’ve tested the above code with Aspose Email 5.9.0, but this
results in the same (wrong) output as for 5.8.0 (i.e. includes the BOM). Do I need to set a flag (or something similar) or isn’t the bug fixed yet?
I’ve tested it with 16.10.0 and there it seems to be correct. But I haven’t tried a never version.