Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem in displaying the Japanese character

807589Dec 30 2008 — edited Jan 8 2009
Hi

Im trying to display the Japanese characters in pdf report(Using iText Report). I have the method as follows which is encoding the characters in a particular format in my say, Reports.java

public String stringFormat( String strData ) throws Exception {

String result=null;
try{
result = new String(strData.toString().getBytes("Shift-JIS"),"UTF-8");

}catch(Exception e) {}
return result;
}

Im calling this method to display a category code in another one java file like

Phrase colm_2 = new Phrase(report.stringFormat(strCatgdes),font);

But Im nt getting the correct japanese chars, instead im seeing like this ??????? in my pdf report. I tried with different encoding char set like "ISO2022JP,EUC_JP,SJIS,Shift-JIS,MS932,Cp33722". All giving the wrong characters.

Can anyone help me to solve this issue?

Thanks in Advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 5 2009
Added on Dec 30 2008
8 comments
1,215 views