Posted By

hyderai on 10/27/11


Tagged


Versions (?)

isTraditionalChineseCharacter


 / Published in: Java
 

URL: http://www.javaworld.com.tw/jute/post/view?bid=29&id=10154&sty=3&keywords=Kahn

  1. boolean isTraditionalChineseCharacter(char c) {
  2. if(!Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS.equals(block) &&
  3. !Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS.equals(block) &&
  4. !Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A.equals(block))
  5. {
  6. return false;
  7. }
  8. try {
  9. String s = ""+c;
  10. return s.equals(new String(s.getBytes("MS950"), "MS950"));
  11. } catch (java.io.UnsupportedEncodingException e) {
  12. return false;
  13. }
  14. }

Report this snippet  

You need to login to post a comment.