Hi all
When I run the tests for the bash, the sub-test unicode3.sub of
intl.tests failed.
The sub-test unicode3.sub contain the following:
payload=$'\065\247\100\063\231\053\306\123\070\237\242\352\263'
"$payload"
printf %q "$payload"
In this situation, the format string "%q" in command printf means that
when the
character in the payload is not in {alpha & digit & punctuation & ISO
646(7-bit)}, it
would print the string with ANSI-C style quoted string: $'...' , we can
check the source code
at:
http://git.savannah.gnu.org/cgit/bash.git/tree/builtins/printf.def#n557
http://git.savannah.gnu.org/cgit/bash.git/tree/lib/sh/strtrans.c#n207
Because the payload variable contain the above situation, so the test
results look like $'...' ,
when compared with the intl.right that contain the converted
character(extended ASCII), so
the test failed.
Can we remove the format string "%q", so just
printf "$payload"
In this way, the output of test is same as the intl.right.
//dengke