summaryrefslogtreecommitdiff
path: root/src/core/recode.c
diff options
context:
space:
mode:
authorValentin Batz <senneth@irssi.org>2004-09-20 12:45:49 +0000
committersenneth <senneth@dbcabf3a-b0e7-0310-adc4-f8d773084564>2004-09-20 12:45:49 +0000
commita26038c6647498077bc75b5bda76913f071dac04 (patch)
treeba8f3134bc80449e0c27db37a13c98b49640ec6b /src/core/recode.c
parent4cc4ddc1a796aa2e579e61acefc0348022de7e4f (diff)
downloadirssi-a26038c6647498077bc75b5bda76913f071dac04.zip
Changed the order of recode_out_default_charset, it doesn't override /recode add anymore. The string returned by nl_langinfo(CODESET) may be empty, use ISO8859-1 in this case
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3306 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/recode.c')
-rw-r--r--src/core/recode.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/core/recode.c b/src/core/recode.c
index 07cbe50c..11128635 100644
--- a/src/core/recode.c
+++ b/src/core/recode.c
@@ -76,14 +76,14 @@ char *recode_in(const char *str, const char *target)
int len;
if (!str)
- return g_strdup(str);
+ return NULL;
len = strlen(str);
str_is_utf8 = g_utf8_validate(str, len, NULL);
translit = settings_get_bool("recode_transliterate");
- if (target != NULL && from == NULL)
+ if (target != NULL)
from = iconfig_get_str("conversions", target, NULL);
term_is_utf8 = recode_get_charset(&to);
@@ -120,12 +120,11 @@ char *recode_out(const char *str, const char *target)
#ifdef HAVE_GLIB2
char *recoded = NULL;
const char *from = NULL;
- gboolean translit;
- gboolean term_is_utf8;
+ gboolean translit, term_is_utf8;
int len;
if (!str)
- return g_strdup(str);
+ return NULL;
len = strlen(str);
@@ -135,10 +134,11 @@ char *recode_out(const char *str, const char *target)
const char *to = NULL;
char *translit_to = NULL;
- /* default outgoing charset if set */
- to = settings_get_str("recode_out_default_charset");
+ to = iconfig_get_str("conversions", target, NULL);
if (to == NULL || *to == '\0')
- to = iconfig_get_str("conversions", target, NULL);
+ /* default outgoing charset if set */
+ to = settings_get_str("recode_out_default_charset");
+
if (to && *to != '\0') {
if (translit && !is_translit(to))
to = translit_to = g_strconcat(to ,"//TRANSLIT", NULL);
@@ -150,7 +150,7 @@ char *recode_out(const char *str, const char *target)
}
if (!recoded)
recoded = g_strdup(str);
-
+
return recoded;
#else
return g_strdup(str);