We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Error converting EML to MSG - Unsupported charset utf-32LE

Hi,

I have problem with converting EML to MSG. We are using aspose.email for Java 1.2.0., java 1.5. When I execute the code:

*********
InputStream emlStream = new ByteArrayInputStream(eml);
ByteArrayOutputStream msgStream = new ByteArrayOutputStream();

MailMessage emlMessage = MailMessage.load(emlStream, MessageFormat.getEml());
emlMessage.save(msgStream, MailMessageSaveType.getOutlookMessageFormatUnicode());
*********

I get an exception below. The problem is that we’re using java 1.5 and jvm doesn’t support utf-32LE charset, that is supported in java 1.6. The problem is, our customer cannot switch to java 1.6. Is there any way to force the aspose.email not to use UTF-32LE charset? I have noticed that this happens when the original eml message subject contains Czech Republic diacritical characters “ěščřžýáíé”, otherwise everything goes well. But we cannot ignore this in our product.

Thanks for help.

Best Regards

Tom.


-----------------------
… 41 more
Caused by: java.lang.IllegalStateException: java.nio.charset.UnsupportedCharsetException: utf-32LE
at com.aspose.email.private.e.d.j(Unknown Source)
at com.aspose.email.private.e.d.c(Unknown Source)
at com.aspose.email.fS.a(Unknown Source)
at com.aspose.email.iB.a(Unknown Source)
at com.aspose.email.fG.a(Unknown Source)
at com.aspose.email.MailMessage.setSubject(Unknown Source)
at com.aspose.email.MailMessage.h(Unknown Source)
at com.aspose.email.MailMessage.(Unknown Source)
at com.aspose.email.MailMessage.a(Unknown Source)
at com.aspose.email.MailMessage.load(Unknown Source)
at bach.isss.eregistry.aspose.EmailConverter.emlToMsg(EmailConverter.java:23)
at bach.isss.eregistry.DMPU.saveRawMessage(DMPU.java:347)
… 42 more
Caused by: java.nio.charset.UnsupportedCharsetException: utf-32LE
at java.nio.charset.Charset.forName(Charset.java:499)
… 54 more

Hi Tom,


Thank you for using Aspose products.

I am afraid, I am unable to replicate your said issue on my end by using the latest version of Aspose.Email for Java v1.4.0. Please give these latest Jars a try and feed us back with your results.

In case your problem persists then please share your problematic message for our review.

Looking forward to your response.

Hi Babar,

thank you very much for your response. I have download latest jars (Aspose.Email for Java v1.4.0) as you suggested, but the problem is unfortunately the same…

Please find my problematic EML message attached (packed as ZIP). The problem is when I’m using Java JRE 5. It does not contain charset utf-32LE which aspose.email trying to use (charset utf32-LE is available in Java 6 JRE, which I cannot use due to our customer’s software politics).

Thank you very much.

Best Regards

Tom.

--------------------------

exception stack trace:

java.lang.IllegalStateException: java.nio.charset.UnsupportedCharsetException: utf-32LE
at com.aspose.email.private.e.d.j(Unknown Source)
at com.aspose.email.private.e.d.c(Unknown Source)
at com.aspose.email.gb.a(Unknown Source)
at com.aspose.email.iL.a(Unknown Source)
at com.aspose.email.fP.a(Unknown Source)
at com.aspose.email.MailMessage.setSubject(Unknown Source)
at com.aspose.email.MailMessage.h(Unknown Source)
at com.aspose.email.MailMessage.(Unknown Source)
at com.aspose.email.MailMessage.a(Unknown Source)
at com.aspose.email.MailMessage.load(Unknown Source)
at bach.isss.eregistry.aspose.EmailConverter.emlToMsg(EmailConverter.java:23)
at bach.isss.eregistry.test.Test.testConvertEml(Test.java:252)
at bach.isss.eregistry.test.Test.main(Test.java:49)
Caused by: java.nio.charset.UnsupportedCharsetException: utf-32LE
at java.nio.charset.Charset.forName(Charset.java:499)
… 13 more


Hi Tom,


Thank you for your feedback and sample.

I am able to observe the said exception by using the Aspose.Email for Java v1.4.0 and JRE5. A ticket (NETWRKJAVA-33124) has been logged in our bug tracking system to isolate the cause. We will keep you posted with updates on this.

Please accept my apologies for your inconvenience.

Hi Tom,


Thank you for your patience.

It is to announce that we have fixed the problem logged under ticket Id NETWRKJAVA-33124. Please proceed to download the latest version of Aspose.Email for Java v1.5.0 and test it against your issue.

Looking forward to your feedback.
Regards,

Hi Babar,

problem solved…

Thank you very much.

Best Regards

Tom