Java program to output unicode chars in cmd

北慕城南 提交于 2019-12-11 05:22:45

问题


In the java se 7 specifications it is written that

A Java compiler should use the \uxxxx notation as an output format to display Unicode characters when a suitable font is not available.

But when I run the below program, the command prompt displays a Hell?, World! instead of \uxxxx notation.

import java.io.*;

class test{
  public static void main(String args[]){
    System.out.println("Hell\u0c13, World!");
  }
}

As my command prompt doesn't have a suitabe font, the compiler must be printing the below output.

Hell\u0c13, World!

I'm also wondering how the java compiler will determine whether suitable font is available or not. Please help.

来源:https://stackoverflow.com/questions/44627898/java-program-to-output-unicode-chars-in-cmd

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!