[Lazarus] substr return wrong string with some utf8 char

Michael Schnell mschnell at lumino.de
Fri Feb 11 09:24:21 CET 2011


On 02/10/2011 04:00 PM, Graeme Geldenhuys wrote:
>
> Make that UTF8Pos() (in combination with UTF8Copy) because a UTF-8
> character can be anything from 1–4 bytes long.
>
Obviously UTF8Pos() and UTF8Copy() are a lot slower than Pos() and 
Copy(), and in many cases (i.e when that arguments of copy are obtained 
by Pos(), Length, ... ) Copy does what is requested. If single 
characters are the point of interest, this will not work. (Some easy to 
find and to read entry-level documentation on this would be nice, though 
:-) .)

-Michael




More information about the Lazarus mailing list