[Lazarus] Lazarus (UTF8) and Windows: SysToUTF8, UTF8ToSys... Is there a better solution?

Hans-Peter Diettrich DrDiettrich1 at aol.com
Sun Dec 15 05:01:35 CET 2013


Marcos Douglas schrieb:

> How I work:
> 1. I use [string] to represent any type string. But some libs (DLL,
> ActiveX, etc) uses WideString;

That's Windows specific, not portable.

> 2. If I have to create a file, I use UTF8ToSys(FileName)...

Okay for filenames, even if IMO it should not be necessary.

> and if I
> have a TStringList I use SS.Text := UTF8ToSys(Text)... and at the end
> SS.SaveToFile(UTF8ToSys(FileName));

Why that?


> I have many systems coded in FPC+Lazarus only to run on Windows so I ask you:
> Is there some trick to make the FPC+Lazarus to use only ANSI?

Why that? Lazarus is using UTF-8 throughout, so that writing and reading 
files will work the same on all targets.

DoDi





More information about the Lazarus mailing list