From 29090d65904397e1293f267ebd52ddfeafc13f18 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 24 Nov 2022 01:12:01 -0600 Subject: [PATCH] fixup! refactor: remove unused vars, code simplify and minor optimize (#4172) (#4230) set the converter state in isValidUtf8() --- qt/Prefs.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/qt/Prefs.cc b/qt/Prefs.cc index ef5f01f5d..1e07ae917 100644 --- a/qt/Prefs.cc +++ b/qt/Prefs.cc @@ -197,6 +197,7 @@ bool isValidUtf8(QByteArray const& byteArray) auto const* const codec = QTextCodec::codecForName("UTF-8"); auto state = QTextCodec::ConverterState{}; + codec->toUnicode(byteArray.constData(), byteArray.size(), &state); return state.invalidChars == 0; #endif