From: Thomas Jarosch Date: Wed, 31 Dec 2025 10:37:07 +0000 (+0100) Subject: Fix broken error check for iconv_open() result in iso_to_utf8() X-Git-Tag: v2.13~4 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=b5151841934b3e8014f835ef1f1a15967be974dc;p=libi2ncommon Fix broken error check for iconv_open() result in iso_to_utf8() The variable 'i2utf8' was misspelled as the function name 'iso_to_utf8' in the error check. This would cause the error condition to always be false, preventing proper detection of iconv_open() failures. Luckily ISO-8859-1 to UTF-8 should always be available. --- diff --git a/src/stringfunc.cpp b/src/stringfunc.cpp index c6050f4..0e353d5 100644 --- a/src/stringfunc.cpp +++ b/src/stringfunc.cpp @@ -786,7 +786,7 @@ std::string iso_to_utf8(const std::string& isostring) iconv_t i2utf8 = iconv_open("UTF-8", "ISO-8859-1"); - if (iso_to_utf8 == (iconv_t)-1) + if (i2utf8 == (iconv_t)-1) throw runtime_error("iconv can't convert from ISO-8859-1 to UTF-8"); size_t in_size=isostring.size();