boolean isTraditionalChineseCharacter(char c) {
Character.UnicodeBlock block =
Character.UnicodeBlock.of(c);
if(!
Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS.equals(block) &&!
Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS.equals(block) &&!
Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A.equals(block))
{
return false;
}
try {
String s = ""+c;
return s.equals(new String(s.getBytes("MS950"), "MS950"));
} catch (java.io.UnsupportedEncodingException e) {
return false; }
}
沒有留言:
張貼留言