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
Branch
fix-libmagic-encoding-detection-errors
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 9342
Build 13678: Cypress tests for swh-web diffsJenkins
Build 13677: tox-on-jenkinsJenkins
Build 13676: arc lint + arc unit

Event Timeline

ardumont added inline comments.
swh/web/templates/includes/content-display.html
44

cannot

This revision is now accepted and ready to land.Nov 22 2019, 5:50 PM