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

Free Support Forum - aspose.com

'x-windows-950' is not a supported encoding

I want transfer .msg to .eml file or save eml to pst file use following code..it's success on linux but windows 7(64bit MS950 Traditional Chinese) fail.(I guess fail on all windows platform). (email-3.9.0.0-jdk16.jar & jdk1.7.0_45)
MapiMessage mapi = MapiMessage.fromFile(msgFile);

System.out.println("Unicode:" + mapi.isStoreUnicodeOk());

MailMessageInterpretorFactory.getInstance()
.getIntepretor(mapi.getMessageClass()).interpret(mapi)
.save(emlFile, MessageFormat.getEml());
or
MailMessageLoadOptions options = new MailMessageLoadOptions(); options.setMessageFormat(MessageFormat.getEml()); options.setFileCompatibilityMode(FileCompatibilityMode.SkipValidityChecking); options.setPrefferedTextEncoding(Charset.forName("UTF8"));
MailMessage eml = MailMessage.load(emlFile, options);
MapiMessage msg = MapiMessage.fromMailMessage(eml,vOutlookMessageFormat.Unicode);

Exception:
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.aspose.email.fs.a(Unknown Source)
at com.aspose.email.fs.a(Unknown Source)
at com.aspose.email.fs.(Unknown Source)
at com.aspose.email.MapiMessageReader.(Unknown Source)
at com.aspose.email.MapiMessage.fromFile(Unknown Source)
at com.gfactor.email.EmailUtils.msgToEml(EmailUtils.java:30)
at com.gfactor.email.MailMain.main(MailMain.java:39)
Caused by: com.aspose.email.ms.System.IllegalArgumentException: 'x-windows-950' is not a supported e
ncoding
at com.aspose.email.private.h.d.b(Unknown Source)
at com.aspose.email.private.h.d.(Unknown Source)
... 7 more

Hi Chang,


Thank you for contacting Aspose support team.

I have tested the scenario using Aspose.Email for Java 4.0.0 and found that sample MSG file was converted to EML without any exception using first part of your sample code. Could you please test the same sample file with the above mentioned dll version and let us know your feedback?

Hi Kashif:


I have found the encoding issue answer…
The java runtime environment need add -Dfile.encoding=UTF-8 to run the program.

thanks your response…

Hi Chang,


It is nice to know that your problem is resolved. Please feel free to write us back if you have any other query related to Aspose.Email.