normalize UTF8 (translit/deaccent)

Posted by – March 22, 2009

place this in your application.rb (eg)

class String
  def translit
    Unicode.normalize_KD(self).unpack('U*').select{ |cp| cp < 127 }.pack('U*').gsub(/ /,'-').downcase
  end
end

Closed