diff options
Diffstat (limited to 'src/fe-common')
-rw-r--r-- | src/fe-common/core/fe-common-core.c | 4 | ||||
-rw-r--r-- | src/fe-common/core/fe-recode.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/fe-common/core/fe-common-core.c b/src/fe-common/core/fe-common-core.c index 443204cb..ff26d2ca 100644 --- a/src/fe-common/core/fe-common-core.c +++ b/src/fe-common/core/fe-common-core.c @@ -175,7 +175,9 @@ void fe_common_core_init(void) settings_add_bool("lookandfeel", "use_status_window", TRUE); settings_add_bool("lookandfeel", "use_msgs_window", FALSE); #if defined (HAVE_NL_LANGINFO) && defined(CODESET) - settings_add_str("lookandfeel", "term_charset", nl_langinfo(CODESET)); + settings_add_str("lookandfeel", "term_charset", + *nl_langinfo(CODESET) != '\0' ? + nl_langinfo(CODESET) : "ISO8859-1"); #else settings_add_str("lookandfeel", "term_charset", "ISO8859-1"); #endif diff --git a/src/fe-common/core/fe-recode.c b/src/fe-common/core/fe-recode.c index a46e3547..b26a5cbe 100644 --- a/src/fe-common/core/fe-recode.c +++ b/src/fe-common/core/fe-recode.c @@ -165,7 +165,9 @@ static void read_settings(void) term_charset = settings_get_str("term_charset"); if (!is_valid_charset(term_charset)) { #if defined (HAVE_NL_LANGINFO) && defined(CODESET) - settings_set_str("term_charset", is_valid_charset(old_term_charset) ? old_term_charset : nl_langinfo(CODESET)); + settings_set_str("term_charset", is_valid_charset(old_term_charset) ? + old_term_charset : *nl_langinfo(CODESET) != '\0' ? + nl_langinfo(CODESET) : "ISO8859-1"); #else settings_set_str("term_charset", is_valid_charset(old_term_charset) ? old_term_charset : "ISO8859-1"); #endif |