Posted By


hyderai on 10/27/11

Tagged


Statistics


Viewed 208 times
Favorited by 0 user(s)

isTraditionalChineseCharacter


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  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. }

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.