Lazarus 1.8.0, fpc 3.0.4, windows application (with "win32 gui application unchecked") or console application (using LazUTF8). File encoding utf-8 without bom.
writeln('áéí')
produces garbage, contrary to what's said in
http://wiki.freepascal.org/Unicode_Support_in_Lazarus#Writing_to_console
using {$codepage utf8} (or utf-8 with bom) fixes it, but I'm not sure it's recommended to do so:
http://wiki.freepascal.org/Unicode_Support_in_Lazarus#String_Literals
The strange thing is that:
procedure w(const s:string);
begin
writeln(s);
end;w('áéí')
also gives the correct output.
Why? After all I'm using the same string literal.
I suppose there's some underlying automatic conversion going on, but it's very confusing.
Bye
