[Lazarus] substr return wrong string with some utf8 char

José Mejuto joshyfun at gmail.com
Fri Feb 11 10:41:47 CET 2011


Hello Lazarus-List,

Friday, February 11, 2011, 9:24:21 AM, you wrote:

>> Make that UTF8Pos() (in combination with UTF8Copy) because a UTF-8
>> character can be anything from 1–4 bytes long.
MS> Obviously UTF8Pos() and UTF8Copy() are a lot slower than Pos() and
MS> Copy(), and in many cases (i.e when that arguments of copy are obtained

If no checks about utf8 integrity are performed they should not be
that "lot slower", only a bit slower, at least utf8pos, utf8copy is
for sure slower.
A different thing is that current implementation is a bit overengined
which add some overhead.

Is it logical/safe that utf8 functions do not check utf8 integrity ?
I'm talking about utf8pos, utf8copy, etc...

-- 
Best regards,
 José





More information about the Lazarus mailing list