How to get the real length of Japanese string in javascript?

332 Views Asked by At

How can I get the real length of Japanese string? For example, the length() function would return the bytes length, not the actual length.

s = "";

alert(s.length);    // '2'

Is there any way to get the real length which is in this case 1?

0

There are 0 best solutions below