Commit 929c94e0 authored by Yaroslav Sidlovsky's avatar Yaroslav Sidlovsky 💬 Committed by Albert Astals Cid
Browse files

Fixed encoding detection for small texts (up to 3000 bytes)

BUG: 334733
parent 8dc58c76
Pipeline #70353 passed with stage
in 9 minutes and 30 seconds
......@@ -49,6 +49,11 @@ QString Document::toUnicode(const QByteArray &array)
prober.feed(array.mid(charsFeeded, chunkSize));
charsFeeded += chunkSize;
// No more data to feed - take what we have
if (array.size() <= chunkSize) {
encoding = prober.encoding();
}
if (prober.confidence() >= 0.5) {
encoding = prober.encoding();
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment