--- ./src/pmount.c.orig 2007-08-25 20:09:49 +0400 +++ ./src/pmount.c 2007-08-25 20:19:17 +0400 @@ -29,6 +29,7 @@ #include "utils.h" #include "luks.h" #include "config.h" +#include "natspec.h" /* Using our private realpath function */ #include "realpath.h" @@ -727,14 +728,12 @@ /* if no charset was set explicitly, autodetect UTF-8 */ if( !iocharset ) { const char* codeset; - codeset = nl_langinfo( CODESET ); + codeset = natspec_get_filename_encoding(""); debug( "no iocharset given, current locale encoding is %s\n", codeset ); - if( codeset && !strcmp( codeset, "UTF-8" ) ) { - debug( "locale encoding uses UTF-8, setting iocharset to 'utf8'\n" ); - iocharset = "utf8"; - } + debug("no iocharset given, using libnatspec: %s\n",codeset); + iocharset = strdup(codeset); } /* clean stale locks */ --- ./configure.ac.orig 2007-07-03 02:34:16 +0400 +++ ./configure.ac 2007-08-25 22:47:22 +0400 @@ -19,6 +19,14 @@ [AC_MSG_ERROR([Missing sysfs library (install libsysfs-dev or similar?)])])], [AC_MSG_ERROR([Missing /usr/include/sysfs/libsysfs.h (install libsysfs-dev or similar?)])]) + +AC_CHECK_HEADER(natspec.h, + [AC_CHECK_LIB(natspec, natspec_get_filename_encoding, + [LIBS="$LIBS -lnatspec"], + [AC_MSG_ERROR([Missing natspec library (install libnatspec-devel or similar?)])])], + [AC_MSG_ERROR([Missing /usr/include/natspec.h (install libnatspec-devel or similar?)])]) + + # directory configuration AC_ARG_WITH(media-dir, AC_HELP_STRING([--with-media-dir=DIR], [Parent directory for mounts; MUST have trailing slash (default: /media/)]),