Convert a UTF-8 string to ISO-8859-1
1 2 #add this to environment.rb 3 #call to_iso on any UTF8 string to get a ISO string back 4 #example : "Cédez le passage aux français".to_iso 5 6 class String 7 require 'iconv' #this line is not needed in rails ! 8 def to_iso 9 Iconv.conv('ISO-8859-1', 'utf-8', self) 10 end 11 end