[Lazarus] substr return wrong string with some utf8 char

Lukasz Sokol el.es.cr at gmail.com
Fri Feb 11 13:38:58 CET 2011


On 11/02/2011 09:41, José Mejuto wrote:

> 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...
> 

Maybe make the sanity check optional with default true ? 
Or some unit flag, default true and the utf* routines could force check
if told so ?

Not that I know anything about this code but why not let people who 
know what they are doing to skip the check or call check when they know they need to?
(and as I said, in order not to break existing code, default would be to check always)

My £0.000002.

Lukasz





More information about the Lazarus mailing list