<table><tr><td style="">meven added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D29381">View Revision</a></tr></table><br /><div><div><div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">Perhaps it'd make sense to refactor this a bit and construct some test cases around encoding detection so we get a sense of reliablity?

The way I am looking at this: either libmagic always does the best job at detecting encodings, at which point we'll want it as a required dep, or there's something better in which case we don't want libmagic at all and instead use the something better ;)

In the end the user isn't necessarily in charge of what a random file will be encoded with, so I don't think there's a point in letting the user (or the distro) build an inferior product by accidentally not including libmagic. The truth is neither we nor the user can with any certainty say what encodings the thumbnailer will encounter.</pre></div>

<p>Well I am doubting now libmagic is the way to go:<br />
It is quite limited in encoding detection :<br />
<a href="https://invent.kde.org/snippets/875" class="remarkup-link" target="_blank" rel="noreferrer">https://invent.kde.org/snippets/875</a><br />
Compared to <a href="https://en.wikipedia.org/wiki/Character_encoding#Common_character_encodings" class="remarkup-link" target="_blank" rel="noreferrer">https://en.wikipedia.org/wiki/Character_encoding#Common_character_encodings</a></p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R320 KIO Extras</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D29381">https://phabricator.kde.org/D29381</a></div></div><br /><div><strong>To: </strong>meven, Frameworks, sitter, ngraham<br /><strong>Cc: </strong>pino, kde-frameworks-devel, kfm-devel, azyx, nikolaik, pberestov, iasensio, aprcela, fprice, LeGast00n, cblack, fbampaloukas, alexde, Codezela, feverfew, meven, michaelh, spoorun, navarromorales, firef, ngraham, andrebarros, bruns, emmanuelp, rdieter, mikesomov<br /></div>