[Lazarus] substr return wrong string with some utf8 char
Hans-Peter Diettrich
DrDiettrich1 at aol.com
Fri Feb 11 14:26:01 CET 2011
Michael Schnell schrieb:
> With a future "NewStrings" implementation I mean a dynamically coded
> string typed that can hold e.g. "ASCII code page xxxx", "UTF8", "UTF16",
> or "UTF32" content and knows about what is stored and how.
How would you determine the byte count for reading and writing text?
> So "Length"
> with this type can be defined as "character count" and copy can work on
> character length and position, and automatically convert strings if they
> are coded differently.
I don't like automatic string conversion, because:
> Of course certain operations might be really slow if the encoding of the
> data is not appropriate.
Consider what will happen when every procedure or component has its
*own* idea of the "appropriate" encoding...
DoDi
More information about the Lazarus
mailing list