[Lazarus] non Unicodode application

Juha Manninen juha.manninen62 at gmail.com
Mon Feb 15 12:03:59 CET 2016


On Mon, Feb 15, 2016 at 12:20 PM, Michael Schnell <mschnell at lumino.de> wrote:
> Sorry I did not  intend to express any negative attitude, but on the
> contrary am very happy that Lazarus/fpc can provide exactly that
> functionality (8 bit Strings - including TStrins, pos , etc - in a 64 Bit
> application) that (AFAIK ) is not possible with Delphi (which I don't have).

Ok, then I misunderstood.
The new UTF-8 system has been criticised, rightfully so, for changing
the String default codepage to UTF-8 and loosing the original Windows
system codepage.
In ideal situation FPC would allow changing the encoding of String but
leave AnsiString as is.
Now String = AnsiString and our solution is a semi-hack, although much
less of a hack than the old explicit UTF8...() conversion functions.
Still, in my experience the solution is good. In a typical situation
dealing with Unicode I/O it works like magic. When dealing with
Windows system codepage, few lines of explicit conversion are needed.

I have also learned that the encoding wars are quite useless. It is
possible to write code that works with both main encodings at source
level, by using String for individual codepoints and with some helper
functions.
The real complexity of Unicode is beyond encodings.

Juha




More information about the Lazarus mailing list