Hello,
Hi Andi,
Hi!
I send following Mail als Plaintext:
here is the special “s” character: ß
and the result as HTML:
here is the special ?s? character: ?
The problem is the Encoding. My Mail is Windows Encoded and the resulting HTML-File UTF-16. You find the msg-file as attachment.
Best regards,
Andi
Hi Andi,
This sample MSG file is converted to Html format using following code, however no issue is observed in the output Html file. Could you please give it a try using latest version Aspose.Email for Java 6.4.0 and share the feedback with us?
Sample Code
MailMessage mail = MailMessage.load("test with ß-1.msg");
mail.save("test with ß-1_Java.htm", MsgSaveOptions.getDefaultHtml());
Output
here is the special "s" character: ß
I use Aspose.Email for Java 6.3.0.0 at the moment.
Hi Andi,
Please let us know once you are done with your testing. We’ll investigate the issue further in light of your shared information.
Problem still exists with 6.4.0.0
Hi Andi,
As shared earlier in the sample output with you, we are not able to reproduce this issue at our end. Can you please verify that you have provided us with the right sample file?
I downloaded the file and tried it again - same problem. I upload the file to our server (WebSphere Application Server v 8.0) and looked at the HTML-string:
Hi Andi,
When MapiMessage is used to load a message, it uses the Unicode encoding and that is why all the strings have charset UTF-16. This can’t be changed as it is the API’s default behavior. Please try using the MailMessage as suggested above and let us know if that helps.
Is there a reason why it is encoded in UTF-16 and not in UTF-8?
Hi Andi,
If the source MSG file is saved in Unicode format, then the message’s html body will always contains the utf-16 charset to support the unicode characters. If this is raising some issue at your end, please share the exact scenario with complete sample code that we can further use to assist you. If possible, please share some screenshots of the saved output html file that gives rise to problems due to the utf-16 charset. We’ll investigate the problem at our end for assisting you further.