##// END OF EJS Templates
Fixes RepositoriesHelper#to_utf8 test failure for ruby1.8....
Jean-Philippe Lang -
r5049:2201a343e40d
parent child
Show More
@@ -154,6 +154,13 module RepositoriesHelper
154 str = str.encode("US-ASCII", :invalid => :replace,
154 str = str.encode("US-ASCII", :invalid => :replace,
155 :undef => :replace, :replace => '?').encode("UTF-8")
155 :undef => :replace, :replace => '?').encode("UTF-8")
156 end
156 end
157 else
158 # removes invalid UTF8 sequences
159 begin
160 str = Iconv.conv('UTF-8//IGNORE', 'UTF-8', str + ' ')[0..-3]
161 rescue Iconv::InvalidEncoding
162 # "UTF-8//IGNORE" is not supported on some OS
163 end
157 end
164 end
158 str
165 str
159 end
166 end
General Comments 0
You need to be logged in to leave comments. Login now