[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Gawk 3.1.6 bug - \xhh not interpreted properly
From: |
Aharon Robbins |
Subject: |
Re: Gawk 3.1.6 bug - \xhh not interpreted properly |
Date: |
Mon, 08 Jun 2009 00:56:01 +0300 |
Greetings.
Re the below. Please note the following from gawk.info:
`\xHH...'
The hexadecimal value HH, where HH stands for a sequence of
hexadecimal digits (`0'-`9', and either `A'-`F' or `a'-`f'). Like
the same construct in ISO C, the escape sequence continues until
the first nonhexadecimal digit is seen. However, using more than
two hexadecimal digits produces undefined results. (The `\x'
escape sequence is not allowed in POSIX `awk'.)
Thanks,
Arnold
> Subject: Gawk 3.1.6 bug - \xhh not interpreted properly
> Date: Tue, 2 Jun 2009 13:38:22 -0400
> From: "Nielsen, Dan (GE, Corporate)" <address@hidden>
> To: <address@hidden>
> X-OriginalArrivalTime: 02 Jun 2009 17:38:23.0129 (UTC)
> FILETIME=[ED41C090:01C9E3A8]
> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom
> 2.4 (older, 4)
>
>
> # ZERROR10.AWK - \xhh not interpreted properly
> # OS: Windows XP SP2 using GAWK 3.1.6
> # How to run: GAWK -f C:\AWK\ZERROR10.AWK
> BEGIN {
> # NG: using AWK95,GAWK prints: ,orp"
> print("\x22corp\x22")
> # OK: using AWK95,GAWK,MAWK,TAWK prints: "corp"
> print("\x22\x63orp\x22")
> print("\"corp\"")
> print("\042corp\042")
> # as succinct as it gets
> print("")
> print("\x22corp\x22") # GAWK prints: ,orp"
> print("\x22zorp\x22") # GAWK prints: "zorp"
> # if the character following \x22 is 0-9 or a-f
> # then the output is not as expected
> }
>
> Output:
>
> ,orp"
> "corp"
> "corp"
> "corp"
>
> ,orp"
> "zorp"