Jump to content

chinese in jasper


jasperNoob

Recommended Posts

Plzzz...Someone plz give me a clue .... any clue....how to print chinese characters in jasper reports .... moderators pour some help .... i have looked through practically the whole forum now for help .... the documentation isnt much help either ....

 

here's what I have done till now

 

I managed to print chinese characters in my report by using unicode codes in the resource bundle.

eg:

if I want to translate "king" into chinese ill put

king= u4E07u3E82uxxxxxxxx

sth like this in my resource bundle.

It works and prints the chinese characters for those codes. But I have to find out the unicode codes and put them in the resource bundle for this.

 

I want to be able to directly copy paste the chinese characters for king into the resource bundle. Can this be done??

 

 

 

 

Also tell me if thr's any other way of going abt doing internationalization of double byte charaters

 

 

thanks in advance

Post edited by: jasperNoob, at: 2007/03/13 05:09

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

If you use iReport to design your report, you can type/input or copy/paste Chinese characters directly.

 

But if you use resource bundle to store Chinese characters, I have a experience like the following:

 

1. type/input or copy/paste Chinese characters directly in your .properties file

#example:

chinese_surname.king=金

chinese_surname.liu=刘

 

2. save .properties file in UTF-8 or GB18030/GBK/GB2312 or BIG5 encoding as you need

 

3. after you readed from .properties file, convert the encoding of result string from "ISO-8859-1" to the encoding you choosed at step 2, then, you'll get what you want I think...

 

 

:laugh:

Link to comment
Share on other sites

lovetide wrote:

If you use iReport to design your report, you can type/input or copy/paste Chinese characters directly.

But if you use resource bundle to store Chinese characters, I have a experience like the following:

1. type/input or copy/paste Chinese characters directly in your .properties file
#example:
chinese_surname.king=金
chinese_surname.liu=刘

2. save .properties file in UTF-8 or GB18030/GBK/GB2312 or BIG5 encoding as you need

3. after you readed from .properties file, convert the encoding of result string from "ISO-8859-1" to the encoding you choosed at step 2, then, you'll get what you want I think...


:laugh:

 

 

 

 

Well I did steps 1 and 2 .... still doesnt work :(

I put the translations directly in the properties file and saved the file with UTF-8 encoding . Also tried the "unicode" encoding that's available with notepad. Didnt work with that either.

 

I cudnt implement the 3rd step you mentioned. Bcos I dont know what u mean by changing the encoding of the result string. how do you do that?

 

I am attaching the jrxml here if you would like to take a look.

 

And in the properties file I just wrote

 

vars1=出货信æ¯å’Œå›½é™…出货

vars2=金

vars3=刘 [file name=chinese.jrxml size=8939]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/chinese.jrxml[/file]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...