View my complete profile
function getUTF8Len(s) {
var len = 0;
for (var i = 0; i <>
c = s.charCodeAt(i);
if (c <= 0x7f) {
len++;
} else if (c >= 0x80 && c <= 0x7ff) {
len+=3;
} else {
len+=2;
}
} return len;