<% if diff.diff_type == 'sbs' -%>
<table class="filecontent">
<thead>
-<tr><th colspan="4" class="filename"><%=h(to_utf8(table_file.file_name)) %></th></tr>
+<tr>
+ <th colspan="4" class="filename">
+ <%= h(Redmine::CodesetUtil.to_utf8_by_setting(table_file.file_name)) %>
+ </th>
+</tr>
</thead>
<tbody>
<% table_file.each_line do |spacing, line| -%>
<tr>
<th class="line-num"><%= line.nb_line_left %></th>
<td class="line-code <%= line.type_diff_left %>">
- <pre><%=to_utf8 line.html_line_left %></pre>
+ <pre><%= Redmine::CodesetUtil.to_utf8_by_setting(line.html_line_left) %></pre>
</td>
<th class="line-num"><%= line.nb_line_right %></th>
<td class="line-code <%= line.type_diff_right %>">
- <pre><%=to_utf8 line.html_line_right %></pre>
+ <pre><%= Redmine::CodesetUtil.to_utf8_by_setting(line.html_line_right) %></pre>
</td>
</tr>
<% end -%>
<% else -%>
<table class="filecontent">
<thead>
-<tr><th colspan="3" class="filename"><%=h(to_utf8(table_file.file_name)) %></th></tr>
+ <tr>
+ <th colspan="3" class="filename">
+ <%= h(Redmine::CodesetUtil.to_utf8_by_setting(table_file.file_name)) %>
+ </th>
+ </tr>
</thead>
<tbody>
<% table_file.each_line do |spacing, line| %>
<th class="line-num"><%= line.nb_line_left %></th>
<th class="line-num"><%= line.nb_line_right %></th>
<td class="line-code <%= line.type_diff %>">
- <pre><%=to_utf8 line.html_line %></pre>
+ <pre><%= Redmine::CodesetUtil.to_utf8_by_setting(line.html_line) %></pre>
</td>
</tr>
<% end -%>
<table class="filecontent syntaxhl">
<tbody>
<% line_num = 1 %>
-<% syntax_highlight(filename, to_utf8(content)).each_line do |line| %>
+<% syntax_highlight(filename, Redmine::CodesetUtil.to_utf8_by_setting(content)).each_line do |line| %>
<tr>
<th class="line-num" id="L<%= line_num %>">
<a href="#L<%= line_num %>"><%= line_num %></a>
<table class="filecontent annotate syntaxhl">
<tbody>
<% line_num = 1 %>
- <% syntax_highlight(@path, to_utf8(@annotate.content)).each_line do |line| %>
+ <% syntax_highlight(@path, Redmine::CodesetUtil.to_utf8_by_setting(@annotate.content)).each_line do |line| %>
<% revision = @annotate.revisions[line_num - 1] %>
<tr class="bloc-<%= revision.nil? ? 0 : colors[revision.identifier || revision.revision] %>">
<th class="line-num" id="L<%= line_num %>"><a href="#L<%= line_num %>"><%= line_num %></a></th>