mirror of
https://github.com/transmission/transmission
synced 2025-01-03 05:25:52 +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 const* const codec = QTextCodec::codecForName("UTF-8");
|
||||||
auto state = QTextCodec::ConverterState{};
|
auto state = QTextCodec::ConverterState{};
|
||||||
|
codec->toUnicode(byteArray.constData(), byteArray.size(), &state);
|
||||||
return state.invalidChars == 0;
|
return state.invalidChars == 0;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue