The none utf8rtl is problematic as well it should have the same results as the 2.6.4 compiler. The solution is even worst than the problem what happens if I try to do the same on cyrilic based countries? Should I create a OEMString type that is compile time decided or runtime?
As you already know it, I'm afraid I don't have any answers: just a few more questions ...
Concerning the none utf8rtl case with my sample for instance, the "automatic" Free Pascal is also working indeed.
But the problem in this case, is that UTF8 data are put inside a string variable with an ANSI code page (a "real" ANSI code page, I mean: CP_ACP -> Windows.GetACP): so the "automatic" conversion can't work, as the expected data are not the real one.
The same source code with a fix for this problem, and my sample code is still working. For instance, add:
{$CODEPAGE UTF8}
at the beginning of the sample source code (which is encoded here in UTF8, by default in the Lazarus IDE).
IMHO, it could explain most of the wp's results concerning this case, except the UTF8ToConsole one.
Concerning UTF8ToConsole, apparently the UTF8ToConsole is a Lazarus function. So ,it may have the same problem as for UTF8toSys (but it's only a supposition of mine).
** Addition ** The none utf8rtl is problematic as well it should have the same results as the 2.6.4 compiler.
I'm not sure if you mean in this test case (i.e. wp's sample code) or in general ?
Because in general, I'm almost sure it's not the case: not when the source code is UTF8 encoded (Lazarus IDE), and when "string" inside 2.7+ means by default string variable with ANSI data inside.
Of course, it's different if the source code is coming for another provenance, and ANSI encoded.