[Lazarus] TStrings, Windows and Unicode

J├╝rgen Hestermann juergen.hestermann at gmx.de
Wed Oct 24 12:10:24 CEST 2012

Am 2012-10-24 08:58, schrieb Howard Page-Clark:
 > Internally the LCL uses only UTF8 encoding,
 > so stringlists etc. all expect strings in that
 > encoding and process them correctly when supplied
 > (as here) with a string from the IDE Editor which
 > is also UTF8. However the streaming code in SaveToFile
 > eventually calls some Windows system routine which
 > does not handle UTF8 and so requires conversion
 > from the UTF8 filename to be correctly handled.

That's one of the most important drawbacks of Lazarus:
The handling of strings is not consistent in all cases.
There is the theory of having UTF8 but in practice you have to
watch out because in *some* situations the UTF8 paradigma
is *not* valid and you have to convert strings yourself.

But where are these places? Mostly they are not even documented.
So you are left with trial and error (or ransacking the sources
which are often not easy to understand).
I often have the situation that these cases appear suddenly after
using programs for a long time because it took so long until someone
uses a file name with umlauts (or other non-ASCII characters).
That's very frustrating.

More information about the Lazarus mailing list