Page MenuHomeSoftware Heritage

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

Authored by anlambert on Nov 22 2019, 5:29 PM.

Details

Summary

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 T2082

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.

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

anlambert created this revision.Nov 22 2019, 5:29 PM
anlambert edited the test plan for this revision. (Show Details)Nov 22 2019, 5:32 PM
ardumont added inline comments.
swh/web/templates/includes/content-display.html
44

cannot

ardumont accepted this revision.Nov 22 2019, 5:50 PM
This revision is now accepted and ready to land.Nov 22 2019, 5:50 PM
anlambert updated this revision to Diff 8077.Nov 25 2019, 10:51 AM

Update: Fix typo