Commit 39332b7a authored by Toshi MARUYAMA's avatar Toshi MARUYAMA Committed by Eric Davis

scm: prevent diff shows trace if UTF-8 is invalid in Ruby 1.9.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4912 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent d95201c9
......@@ -132,6 +132,10 @@ module RepositoriesHelper
# do nothing here and try the next encoding
end
end
if str.respond_to?(:force_encoding)
str = str.encode("ASCII-8BIT", :invalid => :replace,
:undef => :replace, :replace => '?').encode("UTF-8")
end
str
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