require "unicode"
def strip_international_characters(utf8_string)
Unicode.normalize_KD(utf8_string).gsub(/[^\x00-\x7F]/n, "")
end
strip_international_characters("Smörgåsbord") => "Smorgasbord"
When is this useful? For slugs of course! Take a look at Slugalizer.
It is possible to use the Iconv library too, like below, but it only seems to work on BSD systems (and not Linux systems).
require "iconv"
Iconv.new("ASCII//IGNORE//TRANSLIT", "UTF-8").iconv(text)