delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/10/10/07:27:29

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=1.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE
X-Spam-Check-By: sourceware.org
X-Rocket-MIMEInfo: 001.001,Ck9uIDEwLzkvMjAxMiA3OjI1IFBNLCBPbHVtaWRlIHdyb3RlOgo.IFdoZW4gSSBydW4gb2N0YWwgZHVtcCAob2QpIEkgbm90aWNlIHRoYXQgZXh0ZW5kZWQgQVNDSUkgY2hhcmFjdGVycyBhcmUKPiBkaXNwbGF5ZWQgaW5jb3JyZWN0bHkgYXMgb3JkaW5hcnkgY2hhcmFjdGVycy4gRm9yIGV4YW1wbGUsIHRoZSBleHRlbmRlZAo.IGNoYXJhY3RlcnMgMTkxLCAxOTYsIGFuZCAyMTggYXJlIGRpc3BsYXllZCBhcyAnPycgLCAnRCcgYW5kICdaJwo.IHJlc3BlY3RpdmVseS4gSSB0aG91Z2h0IG9kIHdhcyAnYW5kaW4BMAEBAQE-
References: <50745E1D DOT 5020208 AT web DOT de> <50747B16 DOT 8000209 AT gmail DOT com>
Message-ID: <1349868428.7869.YahooMailNeo@web171404.mail.ir2.yahoo.com>
Date: Wed, 10 Oct 2012 12:27:08 +0100 (BST)
From: GrahamC <grahamc001uk AT yahoo DOT co DOT uk>
Reply-To: GrahamC <grahamc001uk AT yahoo DOT co DOT uk>
Subject: Re: Displaying extended ASCII characters in output of octal dump as hexadecimal
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
In-Reply-To: <50747B16.8000209@gmail.com>
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id q9ABRQ4g004637

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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019