[w3m-dev 04240] nl_langinfo() requires setlocale()

This commit is contained in:
Dai Sato
2007-05-23 12:34:20 +00:00
parent 599bb41857
commit e4305ca608
6 changed files with 24 additions and 13 deletions
+8 -2
View File
@@ -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> * [w3m-dev 03923] <pre> in <table>
* file.c, table.c: avoid extra blanks in 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 * release-0-2-1
* import w3m-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 $
+2 -2
View File
@@ -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 * w3m: WWW wo Miru utility
* *
@@ -53,7 +53,7 @@ typedef int wc_ces; /* XXX: not used */
#define setlocale(category, locale) /* empty */ #define setlocale(category, locale) /* empty */
#endif #endif
#if ENABLE_NLS #ifdef ENABLE_NLS
#include <libintl.h> #include <libintl.h>
#define _(String) gettext (String) #define _(String) gettext (String)
#define N_(String) (String) #define N_(String) (String)
+1
View File
@@ -376,6 +376,7 @@ wc_locale_to_ces(char *locale)
#ifdef HAVE_LANGINFO_CODESET #ifdef HAVE_LANGINFO_CODESET
{ {
char *cs = nl_langinfo(CODESET); char *cs = nl_langinfo(CODESET);
if (cs && strcmp(cs, "US-ASCII"))
return wc_charset_to_ces(cs); return wc_charset_to_ces(cs);
} }
#endif #endif
+4 -2
View File
@@ -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 #define MAINPROGRAM
#include "fm.h" #include "fm.h"
#include <signal.h> #include <signal.h>
@@ -383,8 +383,10 @@ main(int argc, char **argv, char **envp)
#endif #endif
#endif #endif
GC_init(); GC_init();
#if ENABLE_NLS #if defined(ENABLE_NLS) || (defined(USE_M17N) && defined(HAVE_LANGINFO_CODESET))
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
#endif
#ifdef ENABLE_NLS
bindtextdomain(PACKAGE, LOCALEDIR); bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE); textdomain(PACKAGE);
#endif #endif
+2 -2
View File
@@ -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 * w3m menu.c
*/ */
@@ -1711,7 +1711,7 @@ initMenu(void)
#ifdef USE_M17N #ifdef USE_M17N
if (!MainMenuEncode) { if (!MainMenuEncode) {
MenuItem *item; MenuItem *item;
#if ENABLE_NLS #ifdef ENABLE_NLS
/* FIXME: charset that gettext(3) returns */ /* FIXME: charset that gettext(3) returns */
MainMenuCharset = SystemCharset; MainMenuCharset = SystemCharset;
#endif #endif
+6 -4
View File
@@ -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. * Initialization file etc.
*/ */
@@ -790,8 +790,10 @@ show_params(FILE * fp)
char *t = NULL; char *t = NULL;
char *cmt; char *cmt;
#if ENABLE_NLS #ifdef USE_M17N
#ifdef ENABLE_NLS
OptionCharset = SystemCharset; /* FIXME */ OptionCharset = SystemCharset; /* FIXME */
#endif
#endif #endif
fputs("\nconfiguration parameters\n", fp); fputs("\nconfiguration parameters\n", fp);
@@ -1310,10 +1312,10 @@ load_option_panel(void)
if (optionpanel_str == NULL) if (optionpanel_str == NULL)
optionpanel_str = Sprintf(optionpanel_src1, w3m_version, optionpanel_str = Sprintf(optionpanel_src1, w3m_version,
html_quote(localCookie()->ptr), _(CMT_HELPER)); html_quote(localCookie()->ptr), _(CMT_HELPER));
#if ENABLE_NLS #ifdef USE_M17N
#ifdef ENABLE_NLS
OptionCharset = SystemCharset; /* FIXME */ OptionCharset = SystemCharset; /* FIXME */
#endif #endif
#ifdef USE_M17N
if (!OptionEncode) { if (!OptionEncode) {
optionpanel_str = optionpanel_str =
wc_Str_conv(optionpanel_str, OptionCharset, InnerCharset); wc_Str_conv(optionpanel_str, OptionCharset, InnerCharset);