[Lazarus] Making sources compatible with Delphi (but Lazarus is priority)

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Fri May 5 11:01:24 CEST 2017


On 2017-05-05 00:15, Mattias Gaertner via Lazarus wrote:

> I added a FAQ:
> http://wiki.freepascal.org/Better_Unicode_Support_in_Lazarus#What_happens_when_I_use_.24codepage_utf8.3F

Ah, thanks for that explanation.

 
> AFAIK you are using UTF-8 in AnsiString in FPC 2.6.4. That works in
> many cases, because of double fooling the compiler. This trick does not
> work on Windows with RTL file functions though.

Yes and true, but fpGUI supplies its own "wrapper" RTL file functions, thus
it works 100% on all platforms for years. I believe LCL used to do the same.

RawByteString type (yet another string type in FPC & Delphi's arsenal) did
not exist at the time, otherwise I would probably have defined...

  TfpgString = RawByteString;

and used that everywhere.

 
> Of course it would be nicer, if we don't need tricks to get Unicode.

Indeed, and that is why I love solutions implemented by Java and Qt
Framework. They are simple, it works and not confusing. Even Embarcadero
is doing some string type clean-up. Their new Linux compiler completely
removed AnsiString support. After all, why do you need any other
string types when you support the Unicode standard.


Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp


More information about the Lazarus mailing list