Web IDE proposes downloading files instead of editing them when they contain non-ASCII characters and extension is not .txt
Summary
When you want to edit a text file, you usually can do it using the Web IDE. But if its extension is not .txt and it contains non-ASCII characters (like the French 'é'), then it proposes you to download it instead of editing it.
This has first been observed with LaTeX files (.tex extension) with French contents.
Steps to reproduce
Initial steps (skip these now, and look below!)
- Have a file whose extension is
.tex(other than .txt) in your project. - Click on it to edit it.
- Most of the time, you only can download it instead of editing it in the right pane. (For another project of mine, it is systematic. I suspect it is linked with non-ASCII characters like é, è, à, ...)
Real steps: using the Web IDE,
- create a file, without the extension .txt;
- type some contents, including a non-ascii character (example: 'é');
- commit changes;
- try to edit your file again: you can only download it!
Example Project
https://gitlab.com/mathhainaut/tex-test (and more precisely, the file test3.log containing only the single line: "A non-ASCII character: é")
What is the current bug behavior?
Button 'download' in the right pane.
What is the expected correct behavior?
The text of the file in the right pane (even if there is no syntax highlight!)
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
As a first step, just treat .tex text files as .txt files, which are editable. I could edit .tex files by renaming them before, and renaming back after the edition.
As a final step, finish the treatment of issue #22096 (closed) .
~bug Category:Web IDE