aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--config.h.in1
-rwxr-xr-xconfigure63
-rw-r--r--configure.in1
-rw-r--r--libwc/charset.c10
5 files changed, 84 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index c31281a..8def00b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-10-14 Fumitoshi UKAI <ukai@debian.or.jp>
+
+ * Bug#276246: w3m's locale parsing should at least see '@euro' modifier
+ * config.h (HAVE_LANGINFO_CODESET): added
+ * configure.in (AM_LANGINFO_CODESET): added
+ * libwc/charset.c: #include <langinfo.h>
+ (wc_charset_to_ces): use nl_langinfo(CODESET)
+
2004-09-30 Hiroyuki Ito <ZXB01226@nifty.com>
* [w3m-dev 04108] PIPE_BUF
@@ -8580,4 +8588,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.938 2004/09/29 15:44:03 ukai Exp $
+$Id: ChangeLog,v 1.939 2004/10/13 16:52:49 ukai Exp $
diff --git a/config.h.in b/config.h.in
index 28a3dba..38ee8e9 100644
--- a/config.h.in
+++ b/config.h.in
@@ -142,6 +142,7 @@ typedef long clen_t;
#undef HAVE_CHDIR
#undef HAVE_SETPGRP
#undef HAVE_SETLOCALE
+#undef HAVE_LANGINFO_CODESET
#undef SETPGRP_VOID
#ifdef SETPGRP_VOID
diff --git a/configure b/configure
index 1aab4fe..95993e5 100755
--- a/configure
+++ b/configure
@@ -10007,6 +10007,69 @@ _ACEOF
fi
+ echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5
+echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
+if test "${am_cv_langinfo_codeset+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <langinfo.h>
+int
+main ()
+{
+char* cs = nl_langinfo(CODESET);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ am_cv_langinfo_codeset=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+am_cv_langinfo_codeset=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5
+echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
+ if test $am_cv_langinfo_codeset = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LANGINFO_CODESET 1
+_ACEOF
+
+ fi
+
+
echo "$as_me:$LINENO: checking for sys_errlist" >&5
echo $ECHO_N "checking for sys_errlist... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
diff --git a/configure.in b/configure.in
index 1001fbc..70a654d 100644
--- a/configure.in
+++ b/configure.in
@@ -148,6 +148,7 @@ AC_CHECK_FUNCS(strcasecmp strcasestr strchr memcpy strerror bcopy setpgrp chdir
AC_FUNC_STRFTIME
AC_FUNC_WAIT3
AC_FUNC_SETPGRP
+AM_LANGINFO_CODESET
AC_W3M_SYS_ERRLIST
AC_W3M_SIGSETJMP
AC_W3M_SIGNAL
diff --git a/libwc/charset.c b/libwc/charset.c
index 95343b3..e64b6f6 100644
--- a/libwc/charset.c
+++ b/libwc/charset.c
@@ -6,6 +6,10 @@
#include "wc.h"
+#ifdef HAVE_LANGINFO_CODESET
+#include <langinfo.h>
+#endif
+
wc_locale WcLocale = 0;
static struct {
@@ -369,6 +373,12 @@ wc_locale_to_ces(char *locale)
if (*p == 'C' && *(p+1) == '\0')
return WC_CES_US_ASCII;
+#ifdef HAVE_LANGINFO_CODESET
+ {
+ char *cs = nl_langinfo(CODESET);
+ return wc_charset_to_ces(cs);
+ }
+#endif
for (n = 0; *p && *p != '.' && n < 5; p++) {
if ((unsigned char)*p > 0x20)
buf[n++] = tolower(*p);