[fpc-devel] Unicode resource strings

Graeme Geldenhuys graemeg.lists at gmail.com
Tue Aug 21 13:09:52 CEST 2012


On 21 August 2012 11:45, Mattias Gaertner <nc-gaertnma at netcologne.de> wrote:
> I agree that TStringList can easily create a performance problem, but
> afaik loading a text into a GUI is not a good example to
> show conversion overhead.

Maybe so, but it does debunk the statement "does not happen too often".

>> This is a simple example, but look at all the conversions already. Now
>> if UnicodeString uses the correct encoding on each platform, the
>> conversions would be zero!
> No. On Windows you have to open UTF-8 files too.

OK, so zero is maybe incorrect. Let change it to 1 conversion (the
file contents only, seeing that just about nobody stores files in
UTF-16 encoding). Now compare 1 conversion to the multiple conversions
under Linux if the RTL is only UTF-16 based.

And as you so clearly stated in a prior message, it depends on what
your application does. Some programs will be heavily penalised by so
many conversions.

  - Graeme -

fpGUI - a cross-platform Free Pascal GUI toolkit

More information about the fpc-devel mailing list