1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| public class ChineseCharUtil { public static void main(String[] args) { StringBuilder sb = new StringBuilder(); getRangeChar("4E00", "9FA5",sb); getRangeChar("9FA6", "9FFF",sb); getRangeChar("3400", "4DBF",sb); getRangeChar("20000", "2A6DF",sb); getRangeChar("2A700", "2B739",sb); getRangeChar("2B740", "2B81D",sb); getRangeChar("2B820", "2CEA1",sb); getRangeChar("2CEB0", "2EBE0",sb); getRangeChar("30000", "3134A",sb); getRangeChar("31350", "323AF",sb); getRangeChar("2F00", "2FD5",sb); getRangeChar("2E80", "2EF3",sb); getRangeChar("F900", "FAD9",sb); getRangeChar("2F800", "2FA1D",sb); getRangeChar("31C0", "31E3",sb); getRangeChar("2FF0", "2FFB",sb); getRangeChar("3105", "312F",sb); getRangeChar("31A0", "31BF",sb); System.out.println(sb.toString()); }
public static String getRangeChar(String start,String end,StringBuilder contentBuilder){ if(null==contentBuilder){ contentBuilder = new StringBuilder(); } for (int i = Integer.parseInt(start,16); i < Integer.parseInt(end,16); i++) { contentBuilder.append((char) i).append(","); } contentBuilder.append("\n"); return contentBuilder.toString(); } }
|