Commit af40f867 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang Committed by Eric Davis

Fixes RepositoriesHelper#to_utf8 test failure for ruby1.8.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5169 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 8a0574ac
......@@ -154,6 +154,13 @@ module RepositoriesHelper
str = str.encode("US-ASCII", :invalid => :replace,
:undef => :replace, :replace => '?').encode("UTF-8")
end
else
# removes invalid UTF8 sequences
begin
str = Iconv.conv('UTF-8//IGNORE', 'UTF-8', str + ' ')[0..-3]
rescue Iconv::InvalidEncoding
# "UTF-8//IGNORE" is not supported on some OS
end
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