0

Would some one show me how to print out the whole Chinese dictionary with output { unicode, Chinese character) in Java ?

String index = String.valueOf(i) ;
String chineseChar = "\\" + "u4e0" + index ;
System.out.println (index + " => " + chineseChar );

Last statement printed out 0 => \u4e00 The problem was the right hand side should have been a chinese character "One".

What is exactly the range of Chinese encoding in unicode ?

1 Answers1

0

Just use Integer addition

String index = String.valueOf(i) ;
int chineseChar = '\u4e00' + i;
System.out.println (index + " => " + (char)chineseChar );
BlueMandora
  • 154
  • 1
  • 6