[fpc-devel] assign constant text to widestring

Vincent Snijders vsnijders at vodafonevast.nl
Thu Oct 23 13:18:51 CEST 2008

Michael Schnell schreef:
>> The conversion
>> utf-8<->utf-16 is a very expensive operation and the compiler has to
>> insert it all over the place and people would cry about the performance
>> of their programs.
> Of course I do agree.
> If you want to care about performance you need to know what to do: 
> Either use WideString "all over the place" and beware of the LCL API, or 
> use UTF8String  all over the place.
> But if you use UTF8String you need to be aware that you can't do simple 
> and totally normal things like s := copy(s, 3); to get the first three 
> characters of a string. Really finding the first three characters of a 
> string is an interesting and time consuming task with utf8 ;) .
> That is why I feel that it would be a lot better if  the LCL would use a 
> WideString API.

If you want widestring, then maybe mseide is a better option for you.


More information about the fpc-devel mailing list