+ 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
2 odpowiedzi
+ 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);
}
}
0
thank you for your advice,Kirk.