This commit is contained in:
fmmedeiros 2017-11-30 12:48:15 +00:00 committed by GitHub
commit 034ad903cc

View file

@ -112,13 +112,14 @@ char *recode_in(const SERVER_REC *server, const char *str, const char *target)
str_is_utf8 = 1; str_is_utf8 = 1;
autodetect = settings_get_bool("recode_autodetect_utf8"); autodetect = settings_get_bool("recode_autodetect_utf8");
if (autodetect && str_is_utf8) if (autodetect && str_is_utf8) {
if (term_is_utf8) if (term_is_utf8)
return g_strdup(str); return g_strdup(str);
else else
from = "UTF-8"; from = "UTF-8";
else } else {
from = find_conversion(server, target); from = find_conversion(server, target);
}
if (from) if (from)
recoded = g_convert_with_fallback(str, len, to, from, NULL, NULL, NULL, NULL); recoded = g_convert_with_fallback(str, len, to, from, NULL, NULL, NULL, NULL);