summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2013-03-07 08:31:58 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2013-03-07 08:31:58 +0000
commitb19a6d06d91252611571d2d045326daf58a3fb10 (patch)
tree881375296e5967f27f9e1bde567a10c05802447a /lib
parent8e92ffc191354f15775165762efbbf882f9056a3 (diff)
downloadredmine-b19a6d06d91252611571d2d045326daf58a3fb10.tar.gz
redmine-b19a6d06d91252611571d2d045326daf58a3fb10.zip
move utf8 encoding from view to UnifiedDiff (#12641)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11545 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/unified_diff.rb11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/redmine/unified_diff.rb b/lib/redmine/unified_diff.rb
index 9917a554f..d08ab5c01 100644
--- a/lib/redmine/unified_diff.rb
+++ b/lib/redmine/unified_diff.rb
@@ -30,15 +30,8 @@ module Redmine
diff_table = DiffTable.new(diff_type, diff_style)
diff.each do |line|
line_encoding = nil
- if line.respond_to?(:force_encoding)
- line_encoding = line.encoding
- # TODO: UTF-16 and Japanese CP932 which is imcompatible with ASCII
- # In Japan, diffrence between file path encoding
- # and file contents encoding is popular.
- line.force_encoding('ASCII-8BIT')
- end
- unless diff_table.add_line line
- line.force_encoding(line_encoding) if line_encoding
+ line = Redmine::CodesetUtil.to_utf8_by_setting(line)
+ unless diff_table.add_line(line)
self << diff_table if diff_table.length > 0
diff_table = DiffTable.new(diff_type, diff_style)
end