Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files from any .NET platform (C#, VB.NET, ASP.NET, .NET Core) and Java applications (J2SE and J2EE) with fast and high quality performance.

Fri Dec 25, 2020 7:37 am

Hi, I tested the sample code of "Convert Word to Images in Java" and ran into the issue when doing the conversion for certain DOCX files.

[ ENV ]
OS: Windows 10 Pro 1909
System Locale: zh-tw;Chinese (Taiwan)
JRE: OpenJDK Runtime Environment (build 1.8.0_275-b01)
Free Spire.Office for Java (3.9.0)

[ Error ]
Code: Select all
Exception in thread "main" class com.spire.office.packages.sprhmD: 'MS950' is not a supported encoding
com.spire.office.packages.sprljd.spr  (hqc:386)
com.spire.office.packages.sprLLe.spr♦ (Unknown Source)
com.spire.office.packages.sprLLe.spr  (Unknown Source)
com.spire.office.packages.sprLLe.spr  (Unknown Source)
com.spire.office.packages.sprLLe.spr  (Unknown Source)
com.spire.doc.fields.TextRange.spr  (Unknown Source)
com.spire.office.packages.sprqce.spr  (Unknown Source)
com.spire.office.packages.sprqce.spr  (Unknown Source)
com.spire.office.packages.sprqce.spr♦ (Unknown Source)
com.spire.office.packages.sprqce.spr  (Unknown Source)
com.spire.office.packages.sprqce.spr  (Unknown Source)
com.spire.office.packages.sprMDe.spr☺ (Unknown Source)
com.spire.office.packages.sprMDe.spr  (Unknown Source)
com.spire.office.packages.sprMDe.spr☺ (Unknown Source)
com.spire.office.packages.sprMDe.spr  (Unknown Source)
com.spire.office.packages.sprjBe.spr  (Unknown Source)
com.spire.office.packages.spreLe.spr (Unknown Source)
com.spire.office.packages.spreLe.spr♣ (Unknown Source)
com.spire.office.packages.spreLe.spr♦ (Unknown Source)
com.spire.office.packages.sprGTe.spr  (Unknown Source)
com.spire.doc.Document.spr  (Unknown Source)
com.spire.doc.Document.saveToImages(Unknown Source)


I've found the root cause might have something to do with system locale, which was "Chinese (Traditional, Taiwan)" on my computer. If I change it to other value like "English (United States)", the program can be executed successfully.

The problem is that I have no idea how to solve this programmatically using the API you developed.

Attached is one of the files which caused the Exception.
Thanks.
You do not have the required permissions to view the files attached to this post.

seanlin0800
 
Posts: 1
Joined: Fri Dec 25, 2020 6:55 am

Fri Dec 25, 2020 9:28 am

Hello,

Thanks for your inquiry!

According to the information you provided, when the system area is set to Chinese (Traditional, Taiwan), I did reproduce your issue. And I have logged it in our issue tracking system with the ticket SPIREDOC-5368 for further investigation.

We will let you know if there is any update. Sorry for the inconvenience caused.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 225
Joined: Wed Nov 04, 2020 2:29 am

Return to Spire.Doc