I am deploying our war file including aspose jars on a docker container, where it is creating an issue in the converted html.
If the uploaded document contains any smart quotes for single quotes or double quotes, they are getting converted to question marks.
And its happening on the application running inside a docker, where as it is working fine on the application running directly on tomcat on ubuntu(version 18).
@Gptrnt The problem is not in Aspose.Words, but in conversion ByteArrayOutputStream to string. I would suggest you to store HTML or extracted document as a byte array to avoid such problems in future. For example see the following code:
Document dstDocument = new Document("/temp/in.docx");
HtmlSaveOptions saveOptions = new HtmlSaveOptions();
saveOptions.setExportImagesAsBase64(true);
ByteArrayOutputStream docStream = new ByteArrayOutputStream();
dstDocument.save(docStream, saveOptions);
byte[] dstHtmlBytes = docStream.toByteArray();
ByteArrayInputStream bais = new ByteArrayInputStream(dstHtmlBytes);
Document tempDoc = new Document(bais);
tempDoc.save("/temp/out.docx");
I am facing the same issue in my docker container while just taking the text from extracted node. I am taking the text from extracted nodes by below code,
@Gptrnt It looks like this is general Java problem on Linux, but not Aspose.Words issue. For example you can observe the same problem by running the following simple code in Linux Docker:
String test = "“jtest” ,ckdf ,’sdhfjsdhf’";
System.out.println(test);
Exactly the same code run on Windows prints correct output.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.