[Lazarus] Any chance of changing the LCL Unicode encoding to UTF-16?

Michael Van Canneyt michael at freepascal.org
Mon Aug 4 11:14:42 CEST 2008



On Mon, 4 Aug 2008, Graeme Geldenhuys wrote:

> On Mon, Aug 4, 2008 at 12:33 AM, Felipe Monteiro de Carvalho >> That
> is not sane. I think if you are going to make assumptions,
> >> unicodestring being *DEFAULT* utf-8 on Linux and utf-16 on windows (or
> >> whatever native encoding the respective platform has) is the more likely
> >> outcome.
> >
> > Varying encodings are a very unlikely option for the LCL, because a
> > single encoding is much easier for developers to deal with, and we try
> > to keep a consistent path.
> 
> I also can't see a dual encoding working out....

There is no need for a dual encoding in LCL.

Just define
  TLCLString = String(thelazaruslclcodepage);
(or whatever declaration format will be used) and use that consistently 
everywhere.

This way, the LCL programmer knows per definition what the codepage is.
In his own routines, he's still free to do as he pleases. FPC will take 
care of the conversion anyway.

But for the FPC RTL, the situation is totally different, and a varying
encoding is the only sensible thing to do. The implementation details
are not yet sure, but this is the path that will be taken with 99% 
probability, even if only for Delphi compatibility and to keep all parties 
on the mailing lists satisfied.

But as Marco said: the WAIT state is the only correct state for the FPC
users (and that includes Lazarus/fpGUI/mseIDE)

Regardless of that, if the lazarus/fpGUI devels want to make it to 
Lazarus/fpGUI 1.0 still during this millennium, I would not recommend 
switching encoding (again) yet. You must draw the line somewhere.

Michael.



More information about the Lazarus mailing list