Read about our upcoming Code of Conduct on this issue

Commit 347ce399 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge branch 'blame_encoding_error_fix' into 'master'

Fix for a "500: Encoding error" in the blame view

What does this MR do?

- The change enforces UTF-8 encoding on the source line data obtained from the Git.

Are there points in the code the reviewer needs to double check?

- The fix might not be enough to fix all encoding error issues in the blame view. There might be similar encoding issues if there are non-UTF-8 encoded names, for example

Why was this MR needed?

- This change fixes the "500: encoding error" that I get when I try to view the Gitlab source CHANGELOG file.

What are the relevant issue numbers / Feature requests?

- Gitlab issue #894: https://gitlab.com/gitlab-org/gitlab-ce/issues/894

See merge request !298
......@@ -30,5 +30,5 @@
%code
:erb
<% lines.each do |line| %>
<%= highlight(@blob.name, line, true).html_safe %>
<%= highlight(@blob.name, line.force_encoding("utf-8"), true).html_safe %>
<% end %>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment