This is the mail archive of the
cygwin
mailing list for the Cygwin project.
OT: Beeing 'endian' (RE: Unable to open files including Korean names)
- From: "Hannu E K Nevalainen" <garbage_collector at telia dot com>
- To: "ML CygWIN" <cygwin at cygwin dot com>
- Date: Tue, 15 Jun 2004 21:16:33 +0200
- Subject: OT: Beeing 'endian' (RE: Unable to open files including Korean names)
> 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) <grin?>.
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/