[Lazarus] substr return wrong string with some utf8 char

Michael Schnell mschnell at lumino.de
Fri Feb 11 14:07:39 CET 2011


On 02/11/2011 12:49 PM, Hans-Peter Diettrich wrote:
>
>
> Some "NewStrings" model IMO should at least distinguish between ASCII, 
> ANSI and UTF strings:
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. 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.

Of course certain operations might be really slow if the encoding of the 
data is not appropriate.

-Michael




More information about the Lazarus mailing list