RTF special characters when saving as HTML

I’m not sure what to do about MS’s “smart quotes” (and possibly other characters).

File original = new File("id_7.original.rtf");
File rtf = new File("id_7.rtf");
File html = new File("id_7.html");

HtmlSaveOptions hso = new HtmlSaveOptions();
hso.setPrettyFormat(true);
hso.setAllowNegativeLeftIndent(false);
hso.setImagesFolderAlias(PathHelper.getImagesWebPath(id)); //PathHelper and id are mine
hso.setEncoding(Charset.forName("UTF-8"));

Document document = new Document(original.getAbsolutePath());
document.setTrackRevisions(true);
document.protect(ProtectionType.ALLOW_ONLY_REVISIONS, "xxx");
document.save(rtf.getAbsolutePath());
document.save(html.getAbsolutePath(), hso);

Hi Matthew,
Thanks for your request. Unfortunately, I cannot reproduce the problem on my side. I used the following code for testing:

Document doc = new Document("C:\\Temp\\id_7.original.rtf");
HtmlSaveOptions hso = new HtmlSaveOptions();
hso.setPrettyFormat(true);
hso.setAllowNegativeLeftIndent(false);
hso.setEncoding(Charset.forName("UTF-8"));
doc.save("C:\\Temp\\out.html", hso);

I attached the output HTML document produced on my side. As you can see double quotes looks correct.
Best regards,

You’re right. Sorry to waste your time with that one. When I generate my jsp, I have a call with something like page.append(FileHelper.toString(htmlFile)). I replaced that with page.append(FileHelper.toString(htmlFile,“UTF-8”))

Hi
It is perfect that you managed to resolve the problem. Please feel free to ask in case of any issues, we will be glad to help you.
Best regards,