Red Hat Bugzilla – Bug 444702
Debug output of shell does not display utf characters, but rather their octal values
Last modified: 2014-01-12 19:07:14 EST
On the debugmode (-x) of bash, japanese string is not outputed correctly. This
can be reproduced with following simple step.
(in japanese environment with utf8)
$ bash -x -c "echo \"あいうえお\""
+ echo $'\343\201\202\343\201\204\343\201\206\343\201\210\343\201\212'
The real result of bash is correct. Japanese string is outputed.
But, the debug information by -x option is not the correct japanese string.
Actually, this is the octal digits in utf8 of this japanese string.
As the result, it seems that the bash has the string data of command (like echo...)
as the octal numbers. In debugmode (-x opition), the octal numbers is outputed
as is. This octal numbers should be translated before outputing in debugmode.
* Observed behavior
On the debugmode of the bash command, japanese string is not outputed correctly.
Instead of that, octal string is outputed.
* Desired behavior
On the debugmode of the bash command, japanese string should be outputed properly.
Created attachment 304184 [details]
As bash -c "help set" says:
-v Print shell input lines as they are read.
-x Print commands and their arguments as they are executed.
In this case I think this is right behavior. If you want to see japanese string
use -v option.
Development Management has reviewed and declined this request. You may appeal
this decision by reopening this request.