1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-27 05:20:20 -04:00

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
This commit is contained in:
Valentin Batz 2005-06-29 07:47:45 +00:00 committed by vb
parent 37941e84fe
commit eefd999fa4
2 changed files with 17 additions and 4 deletions

View File

@ -26,6 +26,9 @@ You can change them with /SET
Examples: Examples:
/SET recode OFF
to turn off recode completely
/SET recode_fallback <charset> /SET recode_fallback <charset>
to set the fallback charset for incoming events to set the fallback charset for incoming events

View File

@ -73,12 +73,16 @@ char *recode_in(const SERVER_REC *server, const char *str, const char *target)
char *translit_to = NULL; char *translit_to = NULL;
char *recoded = NULL; char *recoded = NULL;
char *tagtarget = NULL; char *tagtarget = NULL;
gboolean term_is_utf8, str_is_utf8, translit; gboolean term_is_utf8, str_is_utf8, translit, recode;
int len; int len;
if (!str) if (!str)
return NULL; return NULL;
recode = settings_get_bool("recode");
if (!recode)
return g_strdup(str);
len = strlen(str); len = strlen(str);
str_is_utf8 = g_utf8_validate(str, len, NULL); str_is_utf8 = g_utf8_validate(str, len, NULL);
@ -127,12 +131,16 @@ char *recode_out(const SERVER_REC *server, const char *str, const char *target)
#ifdef HAVE_GLIB2 #ifdef HAVE_GLIB2
char *recoded = NULL; char *recoded = NULL;
const char *from = NULL; const char *from = NULL;
gboolean translit, term_is_utf8; gboolean translit, term_is_utf8, recode;
int len; int len;
if (!str) if (!str)
return NULL; return NULL;
recode = settings_get_bool("recode");
if (!recode)
return g_strdup(str);
len = strlen(str); len = strlen(str);
translit = settings_get_bool("recode_transliterate"); translit = settings_get_bool("recode_transliterate");
@ -174,6 +182,7 @@ char *recode_out(const SERVER_REC *server, const char *str, const char *target)
void recode_init(void) void recode_init(void)
{ {
settings_add_bool("misc", "recode", TRUE);
settings_add_str("misc", "recode_fallback", "ISO8859-1"); settings_add_str("misc", "recode_fallback", "ISO8859-1");
settings_add_str("misc", "recode_out_default_charset", ""); settings_add_str("misc", "recode_out_default_charset", "");
settings_add_bool("misc", "recode_transliterate", FALSE); settings_add_bool("misc", "recode_transliterate", FALSE);
@ -181,6 +190,7 @@ void recode_init(void)
void recode_deinit(void) void recode_deinit(void)
{ {
settings_remove("recode");
settings_remove("recode_fallback"); settings_remove("recode_fallback");
settings_remove("recode_out_default_charset"); settings_remove("recode_out_default_charset");
settings_remove("recode_transliterate"); settings_remove("recode_transliterate");