is there any solution that i can adopt to print mandarin in java? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

is there any solution that i can adopt to print mandarin in java?

public class Test{ public static void main(String[] args){ System.out.println("x");//x is what i write in mandarin. } } the output : unmappable character for encoding MS950

17th Oct 2017, 5:36 PM
YuHai
YuHai - avatar
2 Answers
+ 3
As far as I know, not on CodePlayground. This may help you outside of it: import java.io.PrintStream; import java.io.UnsupportedEncodingException; public class Chars { public static void main (String[] argv) throws UnsupportedEncodingException { String unicodeMessage = "䶵"; PrintStream out = new PrintStream(System.out, true, "MS950"); out.println(unicodeMessage); unicodeMessage = "\u4DB5"; out = new PrintStream(System.out, true, "UTF-8"); out.println(unicodeMessage); } }
17th Oct 2017, 11:38 PM
Kirk Schafer
Kirk Schafer - avatar
0
thank you for your advice,Kirk.
22nd Oct 2017, 6:19 AM
YuHai
YuHai - avatar