[fpc-pascal] Generic String Functions
Michael Schnell
mschnell at lumino.de
Fri Feb 28 15:31:33 CET 2014
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
More information about the fpc-pascal
mailing list