[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] gawk stops reading input at SUB character
From: |
Eli Zaretskii |
Subject: |
Re: [bug-gawk] gawk stops reading input at SUB character |
Date: |
Tue, 12 Sep 2017 19:47:36 +0300 |
> From: Paavo Tamminen <address@hidden>
> Date: Tue, 12 Sep 2017 17:58:51 +0300
>
> However, I ran into problem as gawk stops reading the input file if there is
> a <SUB> character in the file. The
> character <SUB> is a control character 'substitute', x1A in hex.
>
> input file (test.txt:) has three lines with <SUB> at line two:
> line 1 aA
> line 2 b<SUB>B
> line 3 cC
>
> On windows cmd-promt the following shows output only to the up to character
> b. So <SUB> seems to be
> treated as an end of file.
>
> gawk.exe "{print $0}" test.txt
> line 1 aA
> line 2 b
>
> gawk.exe --version
> GNU Awk 4.1.4, API: 1.1 (GNU MPFR 3.1.0-p8, GNU MP 5.0.2)
>
> My gawk (gawk-4.1.4-w32-bin.zip) is loaded from
> https://sourceforge.net/projects/ezwinports/
This is expected: the default text-mode reads stop at the first ^Z
character. This is a Windows "feature" You should use binary-mode
reads instead:
gawk -v BINMODE=1 "{print $0}" test.txt