aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDai Sato <satodai@w3m.jp>2007-05-23 12:34:20 +0000
committerDai Sato <satodai@w3m.jp>2007-05-23 12:34:20 +0000
commite4305ca608b6dd74732cb877298d74319a4ecba7 (patch)
treedae2e685496b7d3d8d6b6e3e6392db3d5657e470
parent[w3m-dev 03923] avoid extra blanks in pre in table. (diff)
downloadw3m-e4305ca608b6dd74732cb877298d74319a4ecba7.tar.gz
w3m-e4305ca608b6dd74732cb877298d74319a4ecba7.zip
[w3m-dev 04240] nl_langinfo() requires setlocale()
-rw-r--r--ChangeLog10
-rw-r--r--fm.h4
-rw-r--r--libwc/charset.c3
-rw-r--r--main.c6
-rw-r--r--menu.c4
-rw-r--r--rc.c10
6 files changed, 24 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 4cd4352..e810571 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
-2007-04-19 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
+2007-05-23 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
+
+ * [w3m-dev 04240] nl_langinfo() requires setlocale()
+ * fm.h, main.c, menu.c, rc.c: add "#ifdef"s.
+ * libwc/charset.c: add setlocale() for nl_langinfo().
+
+2007-05-23 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
* [w3m-dev 03923] <pre> in <table>
* file.c, table.c: avoid extra blanks in pre in table.
@@ -8826,4 +8832,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.981 2007/05/23 12:26:56 inu Exp $
+$Id: ChangeLog,v 1.982 2007/05/23 12:34:20 inu Exp $
diff --git a/fm.h b/fm.h
index 54581dd..d7c98e1 100644
--- a/fm.h
+++ b/fm.h
@@ -1,4 +1,4 @@
-/* $Id: fm.h,v 1.135 2007/04/19 11:42:29 inu Exp $ */
+/* $Id: fm.h,v 1.136 2007/05/23 12:34:20 inu Exp $ */
/*
* w3m: WWW wo Miru utility
*
@@ -53,7 +53,7 @@ typedef int wc_ces; /* XXX: not used */
#define setlocale(category, locale) /* empty */
#endif
-#if ENABLE_NLS
+#ifdef ENABLE_NLS
#include <libintl.h>
#define _(String) gettext (String)
#define N_(String) (String)
diff --git a/libwc/charset.c b/libwc/charset.c
index e64b6f6..d86a129 100644
--- a/libwc/charset.c
+++ b/libwc/charset.c
@@ -376,7 +376,8 @@ wc_locale_to_ces(char *locale)
#ifdef HAVE_LANGINFO_CODESET
{
char *cs = nl_langinfo(CODESET);
- return wc_charset_to_ces(cs);
+ if (cs && strcmp(cs, "US-ASCII"))
+ return wc_charset_to_ces(cs);
}
#endif
for (n = 0; *p && *p != '.' && n < 5; p++) {
diff --git a/main.c b/main.c
index 5f82970..3010c28 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.253 2006/12/10 10:49:23 inu Exp $ */
+/* $Id: main.c,v 1.254 2007/05/23 12:34:20 inu Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -383,8 +383,10 @@ main(int argc, char **argv, char **envp)
#endif
#endif
GC_init();
-#if ENABLE_NLS
+#if defined(ENABLE_NLS) || (defined(USE_M17N) && defined(HAVE_LANGINFO_CODESET))
setlocale(LC_ALL, "");
+#endif
+#ifdef ENABLE_NLS
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
#endif
diff --git a/menu.c b/menu.c
index d8035e7..774b1bd 100644
--- a/menu.c
+++ b/menu.c
@@ -1,4 +1,4 @@
-/* $Id: menu.c,v 1.45 2006/04/07 13:21:12 inu Exp $ */
+/* $Id: menu.c,v 1.46 2007/05/23 12:34:20 inu Exp $ */
/*
* w3m menu.c
*/
@@ -1711,7 +1711,7 @@ initMenu(void)
#ifdef USE_M17N
if (!MainMenuEncode) {
MenuItem *item;
-#if ENABLE_NLS
+#ifdef ENABLE_NLS
/* FIXME: charset that gettext(3) returns */
MainMenuCharset = SystemCharset;
#endif
diff --git a/rc.c b/rc.c
index 352ba60..dfb6797 100644
--- a/rc.c
+++ b/rc.c
@@ -1,4 +1,4 @@
-/* $Id: rc.c,v 1.103 2006/12/10 11:01:24 inu Exp $ */
+/* $Id: rc.c,v 1.104 2007/05/23 12:34:20 inu Exp $ */
/*
* Initialization file etc.
*/
@@ -790,9 +790,11 @@ show_params(FILE * fp)
char *t = NULL;
char *cmt;
-#if ENABLE_NLS
+#ifdef USE_M17N
+#ifdef ENABLE_NLS
OptionCharset = SystemCharset; /* FIXME */
#endif
+#endif
fputs("\nconfiguration parameters\n", fp);
for (j = 0; sections[j].name != NULL; j++) {
@@ -1310,10 +1312,10 @@ load_option_panel(void)
if (optionpanel_str == NULL)
optionpanel_str = Sprintf(optionpanel_src1, w3m_version,
html_quote(localCookie()->ptr), _(CMT_HELPER));
-#if ENABLE_NLS
+#ifdef USE_M17N
+#ifdef ENABLE_NLS
OptionCharset = SystemCharset; /* FIXME */
#endif
-#ifdef USE_M17N
if (!OptionEncode) {
optionpanel_str =
wc_Str_conv(optionpanel_str, OptionCharset, InnerCharset);