List of utility methods to do Chinese Check
boolean | checkCharIsChiness(char c) check Char Is Chiness return String.valueOf(c).getBytes().length == 2 ? true : false;
|
boolean | isChina(String str) is China return str.matches("[\\u4E00-\\u9FA5]+"); |
boolean | isChinaLanguage(char[] chars) is China Language int[] ints = new int[2]; boolean isChinese = false; int length = chars.length; byte[] bytes = null; for (int i = 0; i < length; i++) { bytes = ("" + chars[i]).getBytes(); if (bytes.length == 2) { ints[0] = bytes[0] & 0xff; ... |
boolean | isChinaLanguage(String str) is China Language char[] chars = str.toCharArray(); int[] ints = new int[2]; boolean isChinese = false; int length = chars.length; byte[] bytes = null; for (int i = 0; i < length; i++) { bytes = ("" + chars[i]).getBytes(); if (bytes.length == 2) { ... |
boolean | isChinaOrEnName(String str) is China Or En Name if (!Strings.isNullOrEmpty(str)) { if (str.matches(ENGLISHNAME)) { return true; if (str.matches(ALLCHINESE)) { return true; return false; |
boolean | isChineseChar(char c) is Chinese Char return String.valueOf(c).getBytes("GBK").length > 1; |