Problem
I want to debug come character mapping issues on the console and I would like to be able to echo a character the screen using its hexadecimal or octal value. Is there a way I can do this?
Solution
You can your shell's echo directive to echo character glyphs to your terminal device using their hexadecimal and octal codes as follows:
To echo a hexadecimal code, from a bash shell prompt type:
echo "\x3A"where 3A is replaced by the hexadecimal code you want to display.
The standard shell, /bin/sh, does not support echoing hexadecimal codes. It does however support octal codes.
To echo an octal code, from the shell prompt type:
echo "\0161"where 161 is replaced by the octal code you want to display.
The SCO Console may be setup to use one of the following codesets:
ISO8859-1
CP437
CP850For more information these codesets including the hexadecimal codes to use and they related glyphs please see:
http://en.wikipedia.org/wiki/ISO/IEC_8859-1http://en.wikipedia.org/wiki/CP437andhttp://en.wikipedia.org/wiki/Cp850