On 02/28/2014 03:09 PM, Marco van de Voort wrote:
Yes, but the point is that the programmer that writes the index into the delete() might not oversee all cases.

You are absolutely right.

But since Unicode is usable in Strings, a "normal programmer" is not really allowed to "write an index" in pos(), delete(), and MyString[i]. To do this a decent understanding of Unicode is necessary (this has been discussed at any length in multiple forums)

The only allowable thing is to use the "index" returned by "pos" in copy() and friends on the same string. This works (mostly) as expected for any encoding.


Well, the trick is not to leave that to chance.

I don't understand. When using Lazarus (if it stays similar to what it is now) your strings will be UTF8. If pos() requires UTF16 you are out of luck.

-Michael
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to