On 22.02.2018 12:21, Luca Olivetti via Lazarus wrote:
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

No, it's not contrary - just the opposite. The problem is that áéí (ANSI 1250 or whatever) have different codes to your console codepage (CP437 or whatever). You should open/edit your program source code in your console codepage - you obviously edit it in ANSI.

The strange thing is that:

procedure w(const s:string);
begin
  writeln(s);
end;

w('áéí')

also gives the correct output.

It looks like writeln ignores the codepage for constant strings but checks it for "normal" strings. You should ask on fpc-devel list for details.

Ondrej
--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to