2018-05-03 15:54:58 +0000, Austin Group Bug Tracker:
[...]
> On page 2492 line 80143 section awk, add to the Description
> column:<blockquote>If the digits produce a value greater than octal 377,
> the behavior is undefined.</blockquote>
[...]
A slightly related question. For printf "%c", POSIX says:
} 7. For the c conversion specifier character: if the
} argument has a numeric value, the character whose encoding
} is that value shall be output. If the value is zero or is
} not the encoding of any character in the character set, the
} behavior is undefined.
What's the "value of the encoding of a character"?
Is that the byte value for single-byte characters? What about
multi-byte characters?
Does that mean it can only be used for single-byte characters?
If so, I think it would be worth mentioning explicitely.
In practice it's true that in locales using the UTF-8 charset,
for instance, printf("%c", 0xe9) inserts a 0xe9 byte (the
encoding of no character at all) in most implementations while
some (gawk) inserts the UTF-8 encoding of the U+00E9 character
(é) (0xc3 0xa9). In UTF-8 locales, one can only use values from
1 to 0x7f portably.
Maybe a clearer wording would be:
7. For the c conversion specifier character: if the argument
has a numeric value, the character whose encoding is one single
byte with that value shall be output. If the value is zero or
is not the encoding of any character in the character set, the
behavior is undefined.
--
Stephane