Remove nasty Microsoft characters from your Ruby program
Need to remove a smart quote or apostrophe?
require 'iconv'
# original_string = grab it from the Microsoft Excel file or whatever
str = Iconv.iconv("UTF-8", "WINDOWS-1252", original_string).to_s
str.gsub!("Ô", "'") # remove Microsoft "smart" apostrophes
str.gsub!("Õ", "'") # variation of previous
str.gsub!("Ò", '"') # remove Microsoft "smart" double quotes
str.gsub!("Ó", '"') # variation of previous
puts str
It uses the Iconv from the Ruby Standard Library.