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
This commit is contained in:
parent
d95201c917
commit
39332b7a72
|
@ -132,6 +132,10 @@ module RepositoriesHelper
|
||||||
# do nothing here and try the next encoding
|
# do nothing here and try the next encoding
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if str.respond_to?(:force_encoding)
|
||||||
|
str = str.encode("ASCII-8BIT", :invalid => :replace,
|
||||||
|
:undef => :replace, :replace => '?').encode("UTF-8")
|
||||||
|
end
|
||||||
str
|
str
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue