From b5151841934b3e8014f835ef1f1a15967be974dc Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Wed, 31 Dec 2025 11:37:07 +0100 Subject: [PATCH] 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. --- src/stringfunc.cpp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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(); -- 1.7.1