From ba8b1d09901311b651cea5c54a0327085cfc10d7 Mon Sep 17 00:00:00 2001 From: germeier Date: Wed, 12 Mar 2003 23:21:30 +0000 Subject: trying to fix iconv UNICODE conversions on BIG_ENDIAN machines --- ChangeLog | 5 +++++ configure.in | 5 +++++ libmpio/directory.c | 12 +++++++----- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index ee36496..c8d81e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-03-13 Markus Germeier + + * trying to fix iconv UNICODE conversions on BIG_ENDIAN + machines (not sure about that one!) + 2003-03-11 Markus Germeier * libmpio/mpio.c (mpio_init): added code the recognize new MPIO diff --git a/configure.in b/configure.in index 1cfce46..7c33d01 100644 --- a/configure.in +++ b/configure.in @@ -14,6 +14,11 @@ AC_PROG_MAKE_SET AC_PROG_CC AM_PROG_LIBTOOL +dnl Check for endianess + +AC_LANG_C +AC_C_BIGENDIAN + dnl Checks for header files. AC_CHECK_HEADER(getopt.h,HAVE_GETOPT_H=1,HAVE_GETOPT_H=0) diff --git a/libmpio/directory.c b/libmpio/directory.c index 387c31c..f8b64c4 100644 --- a/libmpio/directory.c +++ b/libmpio/directory.c @@ -1,6 +1,6 @@ /* * - * $Id: directory.c,v 1.12 2003/02/21 18:28:54 crunchy Exp $ + * $Id: directory.c,v 1.13 2003/03/12 23:21:31 germeier Exp $ * * Library for USB MPIO-* * @@ -32,6 +32,8 @@ #include "directory.h" #include +#define UNICODE "UNICODELITTLE" + /* the following function is copied from the linux kernel v2.4.18 * file:/usr/src/linux/fs/fat/misc.c * it was written by Werner Almesberger and Igor Zhbanov @@ -80,12 +82,12 @@ mpio_charset_set(mpio_t *m, BYTE *charset) iconv_t ic; int r = 1; - ic = iconv_open("UNICODE", charset); + ic = iconv_open(UNICODE, charset); if (ic < 0) r=0; iconv_close(ic); - ic = iconv_open(charset, "UNICODE"); + ic = iconv_open(charset, UNICODE); if (ic < 0) r=0; iconv_close(ic); @@ -294,7 +296,7 @@ mpio_dentry_get_real(mpio_t *m, mpio_mem_t mem, BYTE *buffer, if (vfat) { - ic = iconv_open(m->charset, "UNICODE"); + ic = iconv_open(m->charset, UNICODE); memset(fname, 0, filename_size); hexdumpn(4, unicode, in+2); debugn(4, "before iconv: in: %2d - out: %2d\n", in, out); @@ -509,7 +511,7 @@ mpio_dentry_put(mpio_t *m, mpio_mem_t mem, } /* generate vfat filename in UNICODE */ - ic = iconv_open("UNICODE", m->charset); + ic = iconv_open(UNICODE, m->charset); fin = in = filename_size + 1; fout = out = filename_size * 2 + 2 + 26; fname = malloc(in); -- cgit v1.2.3