%h3.page-title Blame view

#tree-holder.tree-holder
  .file-holder
    .file-title
      %i.fa.fa-file
      %span.file_name
        = @path
        %small= number_to_human_size @blob.size
      %span.options= render "projects/blob/actions"
    .file-content.blame.highlight
      %table
        - @blame.each do |commit, lines, since|
          - commit = Commit.new(commit)
          %tr
            %td.blame-commit
              %span.commit
                = link_to commit.short_id, project_commit_path(@project, commit), class: "commit_short_id"
                &nbsp;
                = commit_author_link(commit, avatar: true, size: 16)
                &nbsp;
                = link_to_gfm truncate(commit.title, length: 20), project_commit_path(@project, commit.id), class: "row_title"
            %td.lines.blame-numbers
              %pre
                - (since...(since + lines.count)).each do |i|
                  = i
                  \
            %td.lines
              %pre{class: 'code highlight white'}
                %code
                  :erb
                    <% lines.each do |line| %>
                      <%= highlight(@blob.name, line, true).html_safe %>
                    <% end %>

%h3.page-title Blame view

#tree-holder.tree-holder
  .file-holder
    .file-title
      %i.fa.fa-file
      %span.file_name
        = @path
        %small= number_to_human_size @blob.size
      %span.options= render "projects/blob/actions"
    .file-content.blame.highlight
      %table
        - @blame.each do |commit, lines, since|
          - commit = Commit.new(commit)
          %tr
            %td.blame-commit
              %span.commit
                = link_to commit.short_id, project_commit_path(@project, commit), class: "commit_short_id"
                &nbsp;
                = commit_author_link(commit, avatar: true, size: 16)
                &nbsp;
                = link_to_gfm truncate(commit.title, length: 20), project_commit_path(@project, commit.id), class: "row_title"
            %td.lines.blame-numbers
              %pre
                - (since...(since + lines.count)).each do |i|
                  = i
                  \
            %td.lines
              %pre{class: 'code highlight white'}
                %code
                  :erb
                    <% lines.each do |line| %>
                      <%= highlight(@blob.name, line.force_encoding("utf-8"), true).html_safe %>
                    <% end %>

Fix "500: Encoding error" on blame view
Fix "500: Encoding error" on blame view

This change forces encoding of source line data into UTF-8 and thus
fixes the encoding error at least partially. The issue is described in
https://gitlab.com/gitlab-org/gitlab-ce/issues/894
