Saturday, September 3, 2005

Printing the unicode characters to console from java program

I did bit of R and to print the unicode characters from Java.. and finally i found that its a very simple thing and can be done in couple of ways

1) using the java file.encoding system parameter -Dfile.encoding=UTF8. the advantage with this is your program can be run with multiple encodings
2) in java program like

public class InternationalHello {
public static void main (String[] argv) {
String helloInTelugu = "\U0C39\U0C32\UoC4B";

PrintStream out = System.out;
out.println(helloInTelugu );
}
}

cool and easy right..................

No comments: