[Lazarus] Lazarus (UTF8) and Windows: SysToUTF8, UTF8ToSys... Is there a better solution?

Jürgen Hestermann juergen.hestermann at gmx.de
Mon Dec 23 18:52:21 CET 2013


Am 2013-12-23 11:32, schrieb Marco van de Voort:
 > So I would say UTF16, and maybe, if there is demand, some can get utf8 :-)

The question is:
Should FPC and LCL use a fixed encoding for all platforms
or should the encoding be adapted for each WidgetSet/OS?


If it should be the same for all platforms then it should be UTF8 IMO.
UTF16 is the most horrible decision (all bad things combined).
UTF32 would at least have the advantage of fixed character size
but pays this with *a lot* of memory consumption.
UTF8 has the lowest memory demand (in general) and a good
backward compatibility.


On the other hand, adapting the string encoding for each
Widgetset/OS would be a can of worms IMO.
A lot of additional knowledge about strings is put on the programmer
because handling of strings has to be done differently depending on OS.
That would be a hazadous decision and would only be of use if programs
are exclusively written for one OS only.
But FPC/Lazarus is meant to be portable so this should not be done.





More information about the Lazarus mailing list