1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-01 04:14:16 -04:00

Use g_get_charset to retrieve the locale codeset.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4821 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Emanuele Giaquinta 2008-05-14 08:58:04 +00:00 committed by exg
parent c54fa04781
commit b44bcd68cb
2 changed files with 8 additions and 21 deletions

View File

@ -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);

View File

@ -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