
14 Feb
2011
14 Feb
'11
9:05 a.m.
Jeremy Maitin-Shepard <jeremy <at> jeremyms.com> writes:
In cases where there is a limit of the maximum length of a string, I believe that is almost certainly going to be in terms of the encoded length in a particular encoding (i.e.g UTF-8 or UTF-16), rather than in code points.
Cutting any variable-width encoded string after a certain number of code units is as useful as to cut a dollar bill in half. After you have done it, it loose it's value. Having said that, the same applies to cutting a string after a certain number of code points, but here you could compare it to tear off a corner of a bill. Counting graphemes or grapheme clusters is usually the way to go. Regards, Anders Dalvander -- WWFSMD?