summaryrefslogtreecommitdiffstats
path: root/app/views/common
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-11-20 12:04:11 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-11-20 12:04:11 +0000
commitfb75372b86c59b858c7ad60040325ab117495775 (patch)
treef9c295f2e62173b2bf2cad876e6c46415ba30d55 /app/views/common
parent5c85898227df78dd8786256a67eff4b6c0a5fab3 (diff)
downloadredmine-fb75372b86c59b858c7ad60040325ab117495775.tar.gz
redmine-fb75372b86c59b858c7ad60040325ab117495775.zip
scm: attachment: remove "to_utf8" methods from helpers (#2371)
It is confusing that same name methods are in several helpers. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7871 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/common')
-rw-r--r--app/views/common/_diff.html.erb18
-rw-r--r--app/views/common/_file.html.erb2
2 files changed, 14 insertions, 6 deletions
diff --git a/app/views/common/_diff.html.erb b/app/views/common/_diff.html.erb
index 1f3f82540..3e03720f8 100644
--- a/app/views/common/_diff.html.erb
+++ b/app/views/common/_diff.html.erb
@@ -7,7 +7,11 @@
<% 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| -%>
@@ -19,11 +23,11 @@
<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 -%>
@@ -33,7 +37,11 @@
<% 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| %>
@@ -46,7 +54,7 @@
<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 -%>
diff --git a/app/views/common/_file.html.erb b/app/views/common/_file.html.erb
index db00c0617..418073efa 100644
--- a/app/views/common/_file.html.erb
+++ b/app/views/common/_file.html.erb
@@ -2,7 +2,7 @@
<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>