Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-31 Thread Tomas Hajny via fpc-devel
On 2023-08-31 18:19, Ondrej Pokorny via fpc-devel wrote: On 31.08.2023 17:54, Tomas Hajny via fpc-devel wrote: . . 2) Always use the ansistring version when parsing the comments. Obviously, this increases compilation time for directives parsing somewhat - we could possibly measure the impact

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-31 Thread Ondrej Pokorny via fpc-devel
On 31.08.2023 17:54, Tomas Hajny via fpc-devel wrote: On 2023-08-31 17:08, Ondrej Pokorny via fpc-devel wrote: :) We are not at the finish yet. Positive outcome will be when it gets fixed in the compiler source. Yes, I know. I checked your patch briefly now and I don't like the fact that it b

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-31 Thread Tomas Hajny via fpc-devel
On 2023-08-31 17:08, Ondrej Pokorny via fpc-devel wrote: . . :) We are not at the finish yet. Positive outcome will be when it gets fixed in the compiler source. Yes, I know. I checked your patch briefly now and I don't like the fact that it basically duplicates the code of the two original

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-31 Thread Ondrej Pokorny via fpc-devel
Am 31.08.2023 um 9:59 schrieb Tomas Hajny via fpc-devel: On 2023-08-30 23:38, Ondrej Pokorny via fpc-devel wrote: Am 30.08.2023 um 20:21 schrieb Ondrej Pokorny via fpc-devel: Having seen the outputs, I think that the compiler just ignores the source file encoding for {$MESSAGE} and {$NOTE}. It

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-31 Thread Tomas Hajny via fpc-devel
On 2023-08-30 23:38, Ondrej Pokorny via fpc-devel wrote: Am 30.08.2023 um 20:21 schrieb Ondrej Pokorny via fpc-devel: . . Having seen the outputs, I think that the compiler just ignores the source file encoding for {$MESSAGE} and {$NOTE}. It reads them always as ANSI and then converts them

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-30 Thread Ondrej Pokorny via fpc-devel
Am 30.08.2023 um 20:21 schrieb Ondrej Pokorny via fpc-devel: On 30.08.2023 17:35, Tomas Hajny via fpc-devel wrote: On 2023-08-30 17:23, Ondrej Pokorny via fpc-devel wrote: Sorry to bother you with something as trivial: is your t2.pas file really encoded in UTF-8? Because if I compile an ANSI f

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-30 Thread Marco van de Voort via fpc-devel
On 30-8-2023 15:26, Ondrej Pokorny via fpc-devel wrote: Yes, Tomas, in other words: maybe you enabled "Beta support for UTF-8" in language options on your Windows? Try compiling the compiler with the .lpi and turn on the utf-8 option in the lazarus application/manifest screen. But that m

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-30 Thread Ondrej Pokorny via fpc-devel
On 30.08.2023 17:35, Tomas Hajny via fpc-devel wrote: On 2023-08-30 17:23, Ondrej Pokorny via fpc-devel wrote: Sorry to bother you with something as trivial: is your t2.pas file really encoded in UTF-8? Because if I compile an ANSI file with the {$codepage utf8} declaration, then I get "correct

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-30 Thread Tomas Hajny via fpc-devel
On 2023-08-30 17:23, Ondrej Pokorny via fpc-devel wrote: . . Sorry to bother you with something as trivial: is your t2.pas file really encoded in UTF-8? Because if I compile an ANSI file with the {$codepage utf8} declaration, then I get "correct" output. But obviously this is very wrong. You

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-30 Thread Tomas Hajny via fpc-devel
On 2023-08-30 17:12, Ondrej Pokorny wrote: On 30.08.2023 17:04, Tomas Hajny via fpc-devel wrote: (only sent to Ondrej instead of the list by mistake, resending it to the list now) . . Interesting, but it doesn't change anything on the fact that my result is different (and correct) and I

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-30 Thread Ondrej Pokorny via fpc-devel
On 30.08.2023 17:04, Tomas Hajny via fpc-devel wrote: On 2023-08-30 16:32, Ondrej Pokorny via fpc-devel wrote: If you mean https://stackoverflow.com/questions/56419639/what-does-beta-use-unicode-utf-8-for-worldwide-language-support-actually-do, then no, I don't have this option checked. Howev

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-30 Thread Ondrej Pokorny via fpc-devel
On 30.08.2023 17:04, Tomas Hajny via fpc-devel wrote: On 2023-08-30 16:32, Ondrej Pokorny via fpc-devel wrote: If you mean https://stackoverflow.com/questions/56419639/what-does-beta-use-unicode-utf-8-for-worldwide-language-support-actually-do, then no, I don't have this option checked. Howev

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-30 Thread Mattias Gaertner via fpc-devel
On 30.08.23 15:57, Tomas Hajny via fpc-devel wrote: [...] I get the same in cmd.exe and via TProcess. I.e. you open cmd.exe e.g. via the Windows key+R (rather than by shelling from Lazarus)? Of course. [...] ACP is 1252 ConsoleCP 437 Just to be sure - you get this when running the

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-30 Thread Tomas Hajny via fpc-devel
On 2023-08-30 16:32, Ondrej Pokorny via fpc-devel wrote: . . If you mean https://stackoverflow.com/questions/56419639/what-does-beta-use-unicode-utf-8-for-worldwide-language-support-actually-do, then no, I don't have this option checked. However, even if I had it checked (I don't), it couldn't

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-30 Thread Ondrej Pokorny via fpc-devel
On 30.08.2023 16:23, Tomas Hajny via fpc-devel wrote: On 2023-08-30 15:26, Ondrej Pokorny via fpc-devel wrote: On 30.08.2023 13:49, Mattias Gaertner via fpc-devel wrote: On 30.08.23 12:04, Tomas Hajny via fpc-devel wrote: On 2023-08-28 15:53, Ondrej Pokorny via fpc-devel wrote: [...] Your outp

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-30 Thread Tomas Hajny via fpc-devel
On 2023-08-30 15:26, Ondrej Pokorny via fpc-devel wrote: On 30.08.2023 13:49, Mattias Gaertner via fpc-devel wrote: On 30.08.23 12:04, Tomas Hajny via fpc-devel wrote: On 2023-08-28 15:53, Ondrej Pokorny via fpc-devel wrote: [...] Your output is different from mine (using a freshly compiled tru

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-30 Thread Tomas Hajny via fpc-devel
On 2023-08-30 13:49, Mattias Gaertner via fpc-devel wrote: On 30.08.23 12:04, Tomas Hajny via fpc-devel wrote: On 2023-08-28 15:53, Ondrej Pokorny via fpc-devel wrote: [...] Your output is different from mine (using a freshly compiled trunk compiler): Free Pascal Compiler version 3.3.1 [2023/0

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-30 Thread Ondrej Pokorny via fpc-devel
On 30.08.2023 13:49, Mattias Gaertner via fpc-devel wrote: On 30.08.23 12:04, Tomas Hajny via fpc-devel wrote: On 2023-08-28 15:53, Ondrej Pokorny via fpc-devel wrote: [...] Your output is different from mine (using a freshly compiled trunk compiler): Free Pascal Compiler version 3.3.1 [2023/0

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-30 Thread Mattias Gaertner via fpc-devel
On 30.08.23 12:04, Tomas Hajny via fpc-devel wrote: On 2023-08-28 15:53, Ondrej Pokorny via fpc-devel wrote: [...] Your output is different from mine (using a freshly compiled trunk compiler): Free Pascal Compiler version 3.3.1 [2023/08/29] for i386 Copyright (c) 1993-2023 by Florian Klaempfl

Re: [fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-30 Thread Tomas Hajny via fpc-devel
On 2023-08-28 15:53, Ondrej Pokorny via fpc-devel wrote: Hello Ondrej, when compiling a program with fpc on Windows, fpc seems to have the console output encoding wrong. Example program (I am using "ä" because I am on german OS, so "ä" is in my DOS Latin and also in my ANSI codepage): {$code

[fpc-devel] fpc compiler wrong encoding in console output on Windows

2023-08-28 Thread Ondrej Pokorny via fpc-devel
Hello, when compiling a program with fpc on Windows, fpc seems to have the console output encoding wrong. Example program (I am using "ä" because I am on german OS, so "ä" is in my DOS Latin and also in my ANSI codepage): {$codepage utf8} program TestNote; begin {$note ä} end. The console