Forum Bugs

UTF-8 character rendering as question mark in Linux environment

lharkleroad
I have a peculiar bug. Some text copied from a document contains a multibyte "Line Separator" character which is the hex value E2 80 A2 or \u2028. This character renders just fine as white space in a web browser. It also renders as white space in my Prince-generated PDF when the code is run on a Mac. It renders as a question mark when the code is run in a Linux environment. My HTML used to generate the PDF has the meta UTF-8 line, so that shouldn't be an issue. The font used to render the PDF in both Mac and Linux is also the same TTF file. I can't see any notable difference in the environments.

What could be causing the character substitution with a question mark on the Linux environment?

Thanks,
Lance
mikeday
There is probably a fallback font with a glyph for the U+2028 character on MacOS that is not present on Linux. You can check which fonts are being used by running Prince with the --verbose option or checking the font properties in the PDF viewer. A quick workaround would be to simply replace the character with space:
* { prince-text-replace: "\2028" " " }
lharkleroad
Thanks. This did the trick.