[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] print statement problem with hexadecimal escape sequence
From: |
Andrew J. Schorr |
Subject: |
Re: [bug-gawk] print statement problem with hexadecimal escape sequence |
Date: |
Thu, 3 May 2018 10:44:05 -0400 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Thu, May 03, 2018 at 09:15:43AM +0900, Hyunho Cho wrote:
>
>
> There is a erroneous print result with "\xHH" escape sequence that is
> immediately followed by hexadecimal value (0-9a-f)
>
> $ gawk --version
> GNU Awk 4.1.4, API: 1.1 (GNU MPFR 3.1.6, GNU MP 6.1.2)
> Copyright (C) 1989, 1991-2016 Free Software Foundation.
...
> # There is a problem because "F" is hex character that immediately follwing
> "\xHH" escape sequence.
>
> $ awk 'BEGIN { print "\x41\x42\x43FFF" }' | od -a
> 0000000 A B del nl
> 0000004
Have you tried the current version 4.2.1? I believe this has been fixed:
bash-4.2$ ./gawk 'BEGIN { print "\x41\x42\x43FFF" }' | od -a
0000000 A B C F F F nl
0000007
>From the NEWS:
Changes from 4.1.4 to 4.2.0
---------------------------
6. Gawk now processes a maximum of two hexadecimal digits in \x
escape sequences inside strings.
Regards,
Andy