Re: [Lazarus] Garbage writing to console

2018-02-24 Thread R0b0t1 via Lazarus
On Sat, Feb 24, 2018 at 5:17 AM, Juha Manninen via Lazarus wrote: > On Fri, Feb 23, 2018 at 11:15 AM, R0b0t1 via Lazarus > wrote: >> Not to take the thread offtopic, ... > > You took it offtopic anyway. > UTF-8 works just fine. Please

Re: [Lazarus] Garbage writing to console

2018-02-24 Thread Juha Manninen via Lazarus
On Fri, Feb 23, 2018 at 11:15 AM, R0b0t1 via Lazarus wrote: > Not to take the thread offtopic, ... You took it offtopic anyway. UTF-8 works just fine. Please read this page : http://wiki.freepascal.org/Unicode_Support_in_Lazarus and start a new thread if you did

Re: [Lazarus] Garbage writing to console

2018-02-23 Thread Mattias Gaertner via Lazarus
On Fri, 23 Feb 2018 11:18:55 +0100 Mattias Gaertner via Lazarus wrote: >[...] > Write and Writeln are pure compiler magic. > Apparently if the string is CP_ACP, it is passed unchanged to Output, > ignoring the DefaultSystemCodepage variable. I correct myself. ;)

Re: [Lazarus] Garbage writing to console

2018-02-23 Thread Ondrej Pokorny via Lazarus
On 23.02.2018 11:18, Mattias Gaertner via Lazarus wrote: Write and Writeln are pure compiler magic. Apparently if the string is CP_ACP, it is passed unchanged to Output, ignoring the DefaultSystemCodepage variable. Otherwise it converts the string to the console codepage. This allows to write

Re: [Lazarus] Garbage writing to console

2018-02-23 Thread Mattias Gaertner via Lazarus
On Fri, 23 Feb 2018 10:56:11 +0100 Luca Olivetti via Lazarus wrote: > El 23/02/18 a les 09:23, Mattias Gaertner via Lazarus ha escrit: > > On Fri, 23 Feb 2018 08:56:55 +0100 > > Ondrej Pokorny via Lazarus wrote: > > > >> On

Re: [Lazarus] Garbage writing to console

2018-02-23 Thread R0b0t1 via Lazarus
On Fri, Feb 23, 2018 at 3:25 AM, Michael Van Canneyt via Lazarus wrote: > > > On Fri, 23 Feb 2018, R0b0t1 via Lazarus wrote: > >> On Fri, Feb 23, 2018 at 2:29 AM, Ondrej Pokorny via Lazarus >> wrote: >>> >>> OK, you mean it's a wiki

Re: [Lazarus] Garbage writing to console

2018-02-23 Thread Luca Olivetti via Lazarus
El 23/02/18 a les 09:23, Mattias Gaertner via Lazarus ha escrit: On Fri, 23 Feb 2018 08:56:55 +0100 Ondrej Pokorny via Lazarus wrote: On 23.02.2018 8:46, Mattias Gaertner via Lazarus wrote: But this is a Lazarus issue. Why? Because the wiki page is unclear.

Re: [Lazarus] Garbage writing to console

2018-02-23 Thread Michael Van Canneyt via Lazarus
On Fri, 23 Feb 2018, R0b0t1 via Lazarus wrote: On Fri, Feb 23, 2018 at 2:29 AM, Ondrej Pokorny via Lazarus wrote: OK, you mean it's a wiki page issue. I just didn't understand how we could solve it in Lazarus :) I am interested in this thread because I was

Re: [Lazarus] Garbage writing to console

2018-02-23 Thread R0b0t1 via Lazarus
On Fri, Feb 23, 2018 at 2:29 AM, Ondrej Pokorny via Lazarus wrote: > OK, you mean it's a wiki page issue. I just didn't understand how we could > solve it in Lazarus :) > I am interested in this thread because I was under the impression that UTF-8 support in

Re: [Lazarus] Garbage writing to console

2018-02-23 Thread Ondrej Pokorny via Lazarus
On 23.02.2018 9:23, Mattias Gaertner via Lazarus wrote: On Fri, 23 Feb 2018 08:56:55 +0100 Ondrej Pokorny via Lazarus wrote: On 23.02.2018 8:46, Mattias Gaertner via Lazarus wrote: But this is a Lazarus issue. Why? Because the wiki page is unclear.

Re: [Lazarus] Garbage writing to console

2018-02-23 Thread Mattias Gaertner via Lazarus
On Fri, 23 Feb 2018 08:56:55 +0100 Ondrej Pokorny via Lazarus wrote: > On 23.02.2018 8:46, Mattias Gaertner via Lazarus wrote: > > But this is a Lazarus issue. > > Why? Because the wiki page is unclear. writeln('áéí'); // works only with source codepage UTF-8

Re: [Lazarus] Garbage writing to console

2018-02-23 Thread Ondrej Pokorny via Lazarus
On 23.02.2018 8:46, Mattias Gaertner via Lazarus wrote: But this is a Lazarus issue. Why? Ondrej -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus

Re: [Lazarus] Garbage writing to console

2018-02-22 Thread Mattias Gaertner via Lazarus
On Fri, 23 Feb 2018 08:44:23 +0100 Ondrej Pokorny via Lazarus wrote: > OK, sorry. I wrote bullshit. But still, you should ask on fpc-devel list > regarding compiler issues - the right people are there. fpc-devel is about development of the compiler. fpc-pascal is

Re: [Lazarus] Garbage writing to console

2018-02-22 Thread Ondrej Pokorny via Lazarus
OK, sorry. I wrote bullshit. But still, you should ask on fpc-devel list regarding compiler issues - the right people are there. Ondrej -- ___ Lazarus mailing list Lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus

Re: [Lazarus] Garbage writing to console

2018-02-22 Thread Luca Olivetti via Lazarus
El 22/02/18 a les 22:26, Ondrej Pokorny via Lazarus ha escrit: 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('áéí')

Re: [Lazarus] Garbage writing to console

2018-02-22 Thread Ondrej Pokorny via Lazarus
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

Re: [Lazarus] Garbage writing to console

2018-02-22 Thread Luca Olivetti via Lazarus
El 22/02/18 a les 13:46, Luca Olivetti via Lazarus ha escrit: El 22/02/18 a les 13:07, Tony Whyman via Lazarus ha escrit: You may find the "SetTextCodePage" procedure useful when it comes to setting the code page for a Windows console. e.g. SetTextCodePage(stdout,cp_utf8); Same result:

Re: [Lazarus] Garbage writing to console

2018-02-22 Thread Luca Olivetti via Lazarus
El 22/02/18 a les 13:07, Tony Whyman via Lazarus ha escrit: You may find the "SetTextCodePage" procedure useful when it comes to setting the code page for a Windows console. e.g. SetTextCodePage(stdout,cp_utf8); Same result: garbage with writeln, correct result with w See also

Re: [Lazarus] Garbage writing to console

2018-02-22 Thread Tony Whyman via Lazarus
You may find the "SetTextCodePage" procedure useful when it comes to setting the code page for a Windows console. e.g. SetTextCodePage(stdout,cp_utf8); See also https://www.freepascal.org/docs-html/rtl/system/settextcodepage.html On 22/02/18 11:21, Luca Olivetti via Lazarus wrote: Lazarus