Skip to content

browse: Ensure display of valid utf-8 contents detected as binary

libmagic sometimes erroneously detects textual contents as binary while they are valid UTF-8 encoded files, so ensure they can be displayed in swh-web/browse.

Also add encoding information in the message printed in the content view when a content can not be displayed.

Related to #2082 (closed)

Test Plan

Turns out that this kind of content are present in the sample repositories used to populate the sample archive for the tests. So add a new test for that corner case.


Migrated from D2345 (view on Phabricator)

Merge request reports