This discussion is archived
0 Replies Latest reply: Jul 3, 2008 11:15 PM by 807589 RSS

Passing Japanese characters to Java program

807589 Newbie
Currently Being Moderated
Hi,

I am using Java POI APIs for creating/modifying excel spreadsheets. The platform is Solaris. The data to be populated contains both English as well as Japanese characters. The input data to Java program comes from a perl program. When I populate the data in excel or even print using System.out.println, it prints ???... for Japanese characters. The data is in SJIS format.
I tried converting it to UNICODE in java but that doesn't seem to be working.
I also tried using native2ascii for converting the data to UNICODE before it is fed to Java program using the following command
native2ascii -encoding SJIS <Input File> <Output File>
Although it converts the charaters into UNICODE correctly in the form \u8a3c\u523... but when it is input to Java, the program prints the string as such.
But if this string is hardcoded in the program, the Japanese characters are printed correctly.
Could anybody please throw some light as to the data should actually be passed to the Java program.

Thanks