Forum How do I...?

Displaying Japanese / Chinese / Asian characters in prince

kellydigital
We're currently using a Zope / Python environment for users to enter some text and then generate PDF files using prince.

The interface to input the text is in iso-8859-1 encoding, upon entering the information, the text is encoded into utf-8 and stored into the database

So the Japanese character フ becomes &#12501, which is equivalent to the &#x30D5 on your UNICODE Table linked through princexml.com , just that one is in base 10 and one is in base 16

in Dreamweaver, and on our HTML interface, the browser is able to recognize both and print out the フ character

however when we pass the document into prince, the base 10 will yield just the &#12501 as plain text, and the base 16 will yield a ? (Question mark)

Another note is, we have Cyrillic and European characters that are stored into the database as utf-8 in base10 and Prince does recognize and prints out the correct characters. The only notable difference is that these characters encoding is less than 10000 in base 10.

Any insights or help in why Prince picks up Cyrillic and European and not Chinese and Japanese will be great, thanks in advance for any help provided.
mikeday
If characters are appearing as question marks it means that Prince cannot find a glyph for them in any of the specified fonts. Try specifying a Japanese font using the font-family property. (In future we will try to make Prince work a bit harder and look for appropriate fonts for each language without prompting).

The decimal character entity issue sounds strange; they should work exactly the same way as hexadecimal character entities. We'll take a look! :)