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

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Fri May 5 13:14:38 CEST 2017


On 2017-05-05 11:55, Jürgen Hestermann via Lazarus wrote:
> I use UTF-8 internally and
> convert to/from UTF-16 for all Windows API functions and
> I never found any problem with it.
> The time that the API functions requires is so much longer than the
> time for string conversion that it does not matter at all.

This is what I've been doing for years, and I agree, it works great.
Windows is also the only platform (of any modern OS) that doesn't
use UTF-8 as standard - so I consider it the minority.


> A situation where it may be a problem is when reading
> (UTF-16 encoded) text files.

I'm yet to find a UTF-16 encoded text file in the wild. I'm not saying
they don't exist, I'm just saying they are extremely rare and more
like an anomaly. UTF-8 seems to rule the roost and the Internet.

This graph should say it all:

    https://en.wikipedia.org/wiki/File:Utf8webgrowth.svg

  (source):  https://en.wikipedia.org/wiki/UTF-8

Even so, a simple conversion to UTF-8 at load time should resolve
all possible problems.



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