如题 说的详细点

解决方案 »

  1.   

    CANON_EQ: 考虑Unicode字符的规范等价。
    Enables canonical equivalence. 
    When this flag is specified then two characters will be considered to match if, and only if, their full canonical decompositions match. The expression "a\u030A", for example, will match the string "?" when this flag is specified. By default, matching does not take canonical equivalence into account.
      

  2.   

    比如
    Pattern p = Pattern.compile("a\u4e2d",Pattern.CANON_EQ);
    Matcher m = p.matcher("a中");
    boolean b = m.matches();
    b为true
      

  3.   

    但是JAVA本来就是用的Unicode字符集的呀?为什么还要加CANON_EQ参数?
      

  4.   

    java 是 Unicode 的,但是 java 处理的字符串未必是 unicode 的。java 需要支持很多编码。
      

  5.   

    请教:
    1:JAVA默认采用Unicode对java 处理的字符串进行编码或者转码,是不是这样?
    2:byte[] getBytes(String charsetName)  ,得到的byte数组是否就是该字符集的2进制字节串?