JAVA是用Unicode编码来表示字符常量的,而字符常量也可以用16进制编码方式表示,范围从'/u0000'~'/uFFFF',这样就可以表示65535个字符。要是把所有unicode字符表示出来,再加上对应的16进制编码方式表示出来: public class HexString { public static void main(String[] args)throws Exception { OutputStreamWriter fw=new OutputStreamWriter(new FileOutputStream("a.txt"),"UTF-8"); for(int i=0;i<65536;i++) { fw.write(Integer.toHexString(i)+"-->"+(char)i+"/r/n"); } if(fw!=null) fw.close(); System.out.println("ok"); } }