//문자열 바이트 수 계산
//CJK는 한글자당 3, 영문은 1
var byteLength = source.replace(/[\0-\x7f]|([0-\u07ff]|(.))/g,”$&$1$2″).length;

//한글의 경우 자음, 또는 모음 하나만 입력된 경우 찾을 때 사용
//ex> ㄱ, ㄴ, ㄷ, ㄲ, ㅏ, ㅑ, ㅗ 등 의 글자만 입력된 경우를 찾을 때
if( 3 == byteLength && ( 12593 <= source.charCodeAt(0) && 12684 >= source.charCodeAt(0) )){
    return ;
}

Leave a Reply

Your email address will not be published. Required fields are marked *