Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: "Hannu E K Nevalainen" To: "ML CygWIN" Subject: OT: Beeing 'endian' (RE: Unable to open files including Korean names) Date: Tue, 15 Jun 2004 21:16:33 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit In-Reply-To: <20040615141718.GD5948@sab.mazic.org> > From: Jaeho Shin > Sent: Tuesday, June 15, 2004 4:17 PM > Looks like od's output is in little-endian. This identifies them as > U+D55C and U+AE00, `echo -n XX | iconv -f euc-kr -t ucs-2 | od -x -`: > 0000000 5cd5 00ae A better way to explore things is by bypassing the endianness with $ ... | od -t x1z As soon as there is more than 8 bits bunched together, you'll find the end(ian) . Another way might be something like this: $ type -a od od is a function od () { odargs="$@"; if [ -z "$odargs" ] || [ -f "$odargs" ]; then odargs="-A x -w24 -t x1z $odargs"; fi; command od $odargs; unset odargs } od is /usr/bin/od od is /bin/od ( -w24 above <=> $(echo $COLUMNS) = 112 /Hannu E K Nevalainen, B.Sc. EE - 59+16.37'N, 17+12.60'E --76--> -- inline short isLittleEndian(void) { const short testvalue=1; char *p=(char *) & testvalue; return (short)(*p!=0); } -- --END OF MESSAGE-- << File: ATT00010.dat >> -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/