You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 9, 2021. It is now read-only.
There is a problem with UTF8ToConsole on my Windows 10.
I live in Switzerland, but Windows is set to English, and chcp displays 437 as my active codepage.
The following program:
uses LazUTF8, Crt;
var
S: String;
begin
Writeln('Writing the name from a string literal: "Jérémie"');
// ^ garbage
Writeln('Converting UTF-8 string to console (should be implicit?): "', UTF8ToConsole(S), '"');
// ^ garbage
Writeln('Converting UTF-8 string to Windows CodePage: "', UTF8ToWinCP(S), '"');
// ^ TODO: works, but how to make it portable?
ReadKey;
end.
The strange thing is that UTF8ToConsole immediately calls UTF8ToWinCP, which (as demonstrated by the last test case, and also verified using the debugger) produces the right result. The remaining code of UTF8ToConsole however then further processes that result, so that the end result is wrong.