现在已知unicode编码是0x4E00想在java应用程序当中输出对应的中文,
如输出为"-"
而且又想在java程序当,怎么输出对应的unicode的编码 ,
希望指点一下????

解决方案 »

  1.   

    你的这个比较专业了,涉及到uicode 与gbk转换了,估计没有人能回答,去google吧 。
      

  2.   

    public class CharCode { /**
     * @param args
     */
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    String strChina = "中国";
    for (int i = 0; i < strChina.length(); i++)
    System.out.println(Integer.toHexString((int)strChina.charAt(i)));

    String unicode = "4e00";
    System.out.println((char)Integer.parseInt(unicode, 16));
    }}PS: 不涉及Unicode与GBK的转换, 完全是Unicode本身的事情.
      

  3.   

    char a=0x4E00;
     System.out.println(a);