D29381: Thumbnail text: use libmagic to detect encoding

Méven Car noreply at phabricator.kde.org
Tue May 5 08:56:25 BST 2020


meven added inline comments.

INLINE COMMENTS

> sitter wrote in textcreator.cpp:38
> TBH, I would make libmagic required for building the thumbnail plugin. I can't see much of a rationale for why we'd want to support "broken"/insufficient encoding detection when there's code that makes it better.

Without libmagic, it is current state basically UTF-8 with bom detection otherwise local codec.

I did not test exhaustive encodings so I wanted to let the door open for users to not rely on libmagic.
libmagic works well from what I've tested but I could not be absolutely sure for the multiple encodings out there.
Hopefully libmagic does a better job detecting UTF-8 (which I saw) but for users not using much UTF-8...

And libmagic loads a 5M file storing its heuristics each time it loads ( /usr/share/misc/magic.mgc ).
It would be great to keep this in memory somewhere, maybe a static.

REPOSITORY
  R320 KIO Extras

REVISION DETAIL
  https://phabricator.kde.org/D29381

To: meven, #frameworks, sitter, ngraham
Cc: 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20200505/b07f386e/attachment.htm>


More information about the kfm-devel mailing list