-
- Downloads
browse/utils: Robustify content encoding detection
When attempting to re-encode non UTF-8 textual content, use chardet to find the encoding first and use it if the detection confidence is really high. Previously some encoding like SHIFT_JIS (for japanese language) were not correctly detected and thus content were badly rendered in the browse Web UI.
Showing
- requirements-test.txt 1 addition, 0 deletionsrequirements-test.txt
- requirements.txt 1 addition, 0 deletionsrequirements.txt
- swh/web/browse/utils.py 27 additions, 7 deletionsswh/web/browse/utils.py
- swh/web/tests/browse/test_utils.py 12 additions, 0 deletionsswh/web/tests/browse/test_utils.py
- swh/web/tests/browse/views/test_content.py 2 additions, 2 deletionsswh/web/tests/browse/views/test_content.py
- swh/web/tests/data.py 2 additions, 2 deletionsswh/web/tests/data.py
Loading
Please register or sign in to comment