[fpc-devel] Unicode support in RTL - Roadmap

Sergei Gorelkin sergei_gorelkin at mail.ru
Fri Nov 21 14:19:53 CET 2008

Michael Schnell wrote:
>> I prefer it to be counted in bytes. If it is counted in Bytes then I
>> can build a routine that counts in real chars. And we already have a
>> lot of code to handle utf-8 inside ansisstring which depends on that.
>> Counting the elements in real chars is very ineficient.
> This is commonly agreed, But counting in code elements breaks old code 
> counting in code points sometimes is more handy. That is why I vote for 
> making the default syntax (s[i], pos(), copy(), ...) user selectable, 
> while of course providing dedicated functions for both flavors.

If Length() would return its value in chars, what length in *bytes* 
would the following call set:

SetLength(utfstring_1), Length(utfstring_2));



More information about the fpc-devel mailing list