This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Displaying extended ASCII characters in output of octal dump as hexadecimal
- From: GrahamC <grahamc001uk at yahoo dot co dot uk>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Wed, 10 Oct 2012 12:27:08 +0100 (BST)
- Subject: Re: Displaying extended ASCII characters in output of octal dump as hexadecimal
- References: <50745E1D.5020208@web.de> <50747B16.8000209@gmail.com>
- Reply-to: GrahamC <grahamc001uk at yahoo dot co dot uk>
On 10/9/2012 7:25 PM, Olumide wrote:
> When I run octal dump (od) I notice that extended ASCII characters are
> displayed incorrectly as ordinary characters. For example, the extended
> characters 191, 196, and 218 are displayed as '?' , 'D' and 'Z'
> respectively. I thought od was 'anding' the each character with 127, but
> I've been informed that this because my shell/terminal is not configured
> to display non-ASCII characters.
>
> How can I configure Cygwin to display extended characters as in
> hexadecimal format?
>
> Thanks
>
> - Olumide
>
You can specify od -t a -t x1 if you don't mind 2 lines of output for every 16 bytes of data (one line for ascii, another line for hex).
Alternatively write a python script for hex/octal dumping and use the unichr() function for byte values in the 128..255 range.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple