From b986bf5d78faecad40c78aa09db59b41a59c47ee Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Fri, 25 Feb 2022 14:30:54 +0000 Subject: [PATCH] Update: Avoid more complicate process if in_charset is the same as out_charset --- src/util.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util.c b/src/util.c index fb17e88c..7bcab4cb 100644 --- a/src/util.c +++ b/src/util.c @@ -1458,6 +1458,12 @@ char *util_conv_string (const char *string, const char *in_charset, const char * if (string == NULL || in_charset == NULL || out_charset == NULL) return NULL; + if (strcmp(in_charset, out_charset) == 0) { + ret = strdup(string); + if (ret) + return ret; + } + in = xmlFindCharEncodingHandler (in_charset); out = xmlFindCharEncodingHandler (out_charset);