View Full Version : Support for Japanse character set

07-08-2002, 05:50 PM
I just downloaded jfreereport-0.7.4 and need to quickly test it for a multi-national reporting requirement. I am trying to show that jFreereport can handle CJK characters by using the Arial Unicode MS font and quickly modifing the sample reports, but I am not getting an success.

JRE Changes: I am using the font.properties.ja as my font.properties file
Characters to show: I am trying show some japanse character using the following Unicode escaped codes:

I have tried the following:

For report3.xml
I changed the fontname attribute in the group named "Customer" to the following:
<group name="Customer">
<groupheader height="355" fontname="Arial Unicode MS" fontstyle="plain" fontsize="11" baseline="11">
and then I entered some Japanese charcacters in the "Dear \u30c4\u30fc\u30eb\u3068\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3 Customer Label"

After running the report I only got ???? where the Japanese character were entered?

Try 2:
For sampleData4.java:
I added some Japanese chacarters to the static string "The five boxing wizards jump quickly. \u30c4\u30fc\u30eb\u3068\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3"

This worked?

Any suggestions on what I did wrong in try 1:



07-09-2002, 03:27 PM

yes, this is an XML-Issue. XML expects Unicode sequences in the format:

charref := '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'

so you have to write:


in the XML file.

The java-compiler in contrast translates the java unicode sequence using \u as unicode escape, and if your data is stored in the datasource, no escape translation is done.

Have more fun,
said Thomas