|
|
|
|
|
by peteretep
4618 days ago
|
|
> print("你好世界".length); # => 4 NO NO NO NO. 'length' is ... not right, and I don't want to know why it returns 4 for the above, because that's not right. If you want to provide a 'length' function for a Unicode string, you need to know what you are measuring: graphemes, codepoints, bytes? Whichever you decide to use, is inappropriate for 'length'. |
|