summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fe-common/core/fe-common-core.c14
-rw-r--r--src/fe-common/core/fe-recode.c15
2 files changed, 8 insertions, 21 deletions
diff --git a/src/fe-common/core/fe-common-core.c b/src/fe-common/core/fe-common-core.c
index 37eab282..f97aa7e4 100644
--- a/src/fe-common/core/fe-common-core.c
+++ b/src/fe-common/core/fe-common-core.c
@@ -24,9 +24,6 @@
#include "misc.h"
#include "levels.h"
#include "settings.h"
-#ifdef HAVE_NL_LANGINFO
-# include <langinfo.h>
-#endif
#include "servers.h"
#include "channels.h"
@@ -144,6 +141,8 @@ void fe_common_core_register_options(void)
void fe_common_core_init(void)
{
+ const char *str;
+
settings_add_bool("lookandfeel", "timestamps", TRUE);
settings_add_level("lookandfeel", "timestamp_level", "ALL");
settings_add_time("lookandfeel", "timestamp_timeout", "0");
@@ -159,13 +158,8 @@ 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) != '\0' ?
- nl_langinfo(CODESET) : "ISO8859-1");
-#else
- settings_add_str("lookandfeel", "term_charset", "ISO8859-1");
-#endif
+ g_get_charset(&str);
+ settings_add_str("lookandfeel", "term_charset", str);
themes_init();
theme_register(fecommon_core_formats);
diff --git a/src/fe-common/core/fe-recode.c b/src/fe-common/core/fe-recode.c
index b3092a09..ede672ec 100644
--- a/src/fe-common/core/fe-recode.c
+++ b/src/fe-common/core/fe-recode.c
@@ -29,10 +29,6 @@
#include "formats.h"
#include "recode.h"
-#ifdef HAVE_NL_LANGINFO
-# include <langinfo.h>
-#endif
-
static char *recode_fallback = NULL;
static char *recode_out_default = NULL;
static char *term_charset = NULL;
@@ -172,14 +168,11 @@ static void read_settings(void)
g_free(term_charset);
term_charset = g_strdup(settings_get_str("term_charset"));
if (!is_valid_charset(term_charset)) {
+ const char *str;
+
g_free(term_charset);
-#if defined (HAVE_NL_LANGINFO) && defined(CODESET)
- term_charset = is_valid_charset(old_term_charset) ? g_strdup(old_term_charset) :
- *nl_langinfo(CODESET) != '\0' ? g_strdup(nl_langinfo(CODESET)) :
- "ISO8859-1";
-#else
- term_charset = is_valid_charset(old_term_charset) ? g_strdup(old_term_charset) : "ISO8859-1";
-#endif
+ g_get_charset(&str);
+ term_charset = is_valid_charset(old_term_charset) ? g_strdup(old_term_charset) : g_strdup(str);
settings_set_str("term_charset", term_charset);
/* FIXME: move the check of term_charset into fe-text/term.c
it breaks the proper term_input_type