html5_book_원철연 › Markup Language › .bashrc와.bash_profile차이점 › EasyMotion › mac › JavascriptText의ByteLength구하기
javascript에서 text의 byte length 구하기
// get byte length function bytelen(v){ var blen = 0; for(i=0; i<v.length; i++){ var c = v.charAt(i); //escape code의 길이가 4보다 크면 한글 blen += (escape(c).length > 4) ? 2 : 1; } return blen; }