mirror of
https://github.com/transmission/transmission
synced 2025-01-03 13:35:36 +00:00
set the converter state in isValidUtf8()
This commit is contained in:
parent
3ecf0dfccd
commit
29090d6590
1 changed files with 1 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue