1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-03 05:25:52 +00:00

fixup! refactor: remove unused vars, code simplify and minor optimize (#4172) (#4230)

set the converter state in isValidUtf8()
This commit is contained in:
Charles Kerr 2022-11-24 01:12:01 -06:00 committed by GitHub
parent 3ecf0dfccd
commit 29090d6590
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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