HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML Forums › Technical questions / Troubleshooting › Encoding problem › Reply To: Encoding problem
November 9, 2020 at 12:26
#34012
The string you received is typical for a charset mismatch.
As you see your test string is not well-formed HTML. You may solve the issue by a prefixing the string with an HTML header defines the correct charset – in your case it should be UTF-8.
Or you can use readHTML() API method with an encoding parameter, i.e.
https://pd4ml.tech/javadoc/com/pd4ml/PD4ML.html#readHTML-java.io.InputStream-java.net.URL-java.lang.String-
Try to specify “UTF8” there.