1、判断全半角字符
/**
* 判断文字是否为全角字符(全角字符中包括中文字符)
* 半角范围:u0000 - u00FF, uFF61 - uFF9F, uFFE8 - uFFEE
* 全角范围:
* 全角数字(0-9) uFF10 - uFF19
* 全角大文字(A-Z): uFF21 - uFF3A
* 全角小文字(a-z): uFF41 - uFF5A
* 全角平仮名:u3040 - u309F
* 全角片仮名:u30A0 - u30FF
* 全角Latin: uFF01 - uFF5E
* 全角Symbol: uFFE0 - uFFE5
* @param character 要判断的字符
* @return true-是全角字符;false-不是全角字符
*/
function isFullWidthChar(character) {
if (character==null || character=="") {
return false;
}
var uFF61 = parseInt("FF61", 16),
uFF9F = parseInt("FF9F", 16),
uFFE8 = parseInt("FFE8", 16),
uFFEE = parseInt("FFEE", 16);
var iCharacter = parseInt(character.charCodeAt(0));
if (iCharacter < 256) {
return false;
} else if (iCharacter>=uFF61 && iCharacter<=uFF9F) {
return false;
} else if (iCharacter>=uFFE8 && iCharacter<=uFFEE) {
return false;
}
return true;
}