non solo, anche se si facesse
codice:
function truelen(s){
var c, d = "";
var l=s.length
for (var i = 0; i < l; i++) {
c = s.charCodeAt(i);
if (c <= 0x7f) {
d += s.charAt(i);
} else if (c >= 0x80 && c <= 0x7ff) {
d += String.fromCharCode(((c >> 6) & 0x1f) | 0xc0);
d += String.fromCharCode((c & 0x3f) | 0x80);
} else {
d += String.fromCharCode((c >> 12) | 0xe0);
d += String.fromCharCode(((c >> 6) & 0x3f) | 0x80);
d += String.fromCharCode((c & 0x3f) | 0x80);
}
}
return d.length;
}
e la si salvasse in php corretto,
poi js vedrebbe una stringa di 9 caratteri con scritto 24 come lunghezza