summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorValentin Batz <senneth@irssi.org>2005-06-29 07:47:45 +0000
committervb <vb@dbcabf3a-b0e7-0310-adc4-f8d773084564>2005-06-29 07:47:45 +0000
commiteefd999fa446cbb551fdb2b516aa852d435aa0e3 (patch)
tree2b1a4c664f17ec6bff32070857454ad4ea968e1f /src/core
parent37941e84fe2da2817b93f4d6c2fdbedd9f6b90e8 (diff)
downloadirssi-eefd999fa446cbb551fdb2b516aa852d435aa0e3.zip
Added a new boolean setting 'recode' to provide an opportunity to turn off recode completely
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3805 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core')
-rw-r--r--src/core/recode.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/core/recode.c b/src/core/recode.c
index e073169e..353d8ed2 100644
--- a/src/core/recode.c
+++ b/src/core/recode.c
@@ -73,14 +73,18 @@ char *recode_in(const SERVER_REC *server, const char *str, const char *target)
char *translit_to = NULL;
char *recoded = NULL;
char *tagtarget = NULL;
- gboolean term_is_utf8, str_is_utf8, translit;
+ gboolean term_is_utf8, str_is_utf8, translit, recode;
int len;
if (!str)
return NULL;
+ recode = settings_get_bool("recode");
+ if (!recode)
+ return g_strdup(str);
+
len = strlen(str);
-
+
str_is_utf8 = g_utf8_validate(str, len, NULL);
translit = settings_get_bool("recode_transliterate");
@@ -127,12 +131,16 @@ char *recode_out(const SERVER_REC *server, const char *str, const char *target)
#ifdef HAVE_GLIB2
char *recoded = NULL;
const char *from = NULL;
- gboolean translit, term_is_utf8;
+ gboolean translit, term_is_utf8, recode;
int len;
if (!str)
return NULL;
+ recode = settings_get_bool("recode");
+ if (!recode)
+ return g_strdup(str);
+
len = strlen(str);
translit = settings_get_bool("recode_transliterate");
@@ -174,13 +182,15 @@ char *recode_out(const SERVER_REC *server, const char *str, const char *target)
void recode_init(void)
{
+ settings_add_bool("misc", "recode", TRUE);
settings_add_str("misc", "recode_fallback", "ISO8859-1");
settings_add_str("misc", "recode_out_default_charset", "");
settings_add_bool("misc", "recode_transliterate", FALSE);
}
void recode_deinit(void)
-{
+{
+ settings_remove("recode");
settings_remove("recode_fallback");
settings_remove("recode_out_default_charset");
settings_remove("recode_transliterate");