In most projects, "string" is used as an alias to "TFileName", and when the RTL has to call the OS.
At RTL level, there are not the same: you have SetMultiByteConversionCodePage() and SetMultiByteRTLFileSystemCodePage().
In all my projects, and even in mormot.core.os.pas initialization, I force:
{$ifdef ISFPC27}
// we force UTF-8 everywhere on FPC for consistency with Lazarus
SetMultiByteConversionCodePage(CP_UTF8);
SetMultiByteRTLFileSystemCodePage(CP_UTF8);
{$endif ISFPC27}
This is done even for console/server applications, for simplicity and consistency.
IMHO CP_UTF8 is much better than UTF-16, even on Windows.
https://utf8everywhere.org/The time to make a UTF8/UTF16 translation with the API is negligeable.
And I would not trust Microsoft to have properly implemented the CP_UTF8 at system level. Just use the existing code with UTF-16 parameters.
I would not change any default behavior. Removing
-dDisableUTF8RTL would make no difference to me.
Keep it as such, with the SetMultiByte*() functions, unless you want
string = UnicodeString like in Delphi and in that case, just use the new mode available in trunk.
But I suspect no-one is using this
-dDisableUTF8RTL anywhere but in some very old and unmaintained project, which could stay with a FPC 3.2 anyway.