On Mon, 4 Apr 2016, Mattias Gaertner wrote:

On Mon, 4 Apr 2016 10:32:58 +0200 (CEST)
Michael Van Canneyt <mich...@freepascal.org> wrote:

[...]
You cannot, but you can set DefaultSystemCodePage to CP_UTF8.

I think it is important to note how to do this properly:

 SetMultiByteConversionCodePage(CP_UTF8);
 SetMultiByteRTLFileSystemCodePage(CP_UTF8);

You should add these lines in an early initialization section. The
beginning of your program might be too late.

Then no conversions will be done for all ansistrings that contain UTF8.

And this really means AnsiString, not AnsiString(something).

The latter cannot contain UTF8 unless you do some really nasty tricks... :-)

Michael
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to