title: Ruby method to remove accents from UTF-8 international characters
body: <p>I am trying to create a 'normalized' copy of a string, to help reduce duplicate names in a database. The names contain many international characters (ie. accented letters), and I want to create a copy with the accents removed. </p>
  
  <p>I did come across the method below, but cannot get it to work. I can't seem to find what the Unicode Hacks plugin is.</p>
  
  <pre><code>  # Utility method that retursn an ASCIIfied, downcased, and sanitized string.
    # It relies on the Unicode Hacks plugin by means of String#chars. We assume
    # $KCODE is 'u' in environment.rb. By now we support a wide range of latin
    # accented letters, based on the Unicode Character Palette bundled inMacs.
    def self.normalize(str)
       n = str.chars.downcase.strip.to_s
       n.gsub!(/[Ã Ã¡Ã¢Ã£Ã¤Ã¥ÄÄ?]/u,    'a')
       n.gsub!(/Ã¦/u,                  'ae')
       n.gsub!(/[ÄÄ?]/u,                'd')
       n.gsub!(/[Ã§Ä?ÄÄ?Ä?]/u,          'c')
       n.gsub!(/[Ã¨Ã©ÃªÃ«Ä?Ä?Ä?Ä?Ä?]/u, 'e')
       n.gsub!(/Æ?/u,                   'f')
       n.gsub!(/[ÄÄ?Ä¡Ä£]/u,            'g')
       n.gsub!(/[Ä¥Ä§]/,                'h')
       n.gsub!(/[Ã¬Ã¬Ã­Ã®Ã¯Ä«Ä©Ä­]/u,     'i')
       n.gsub!(/[Ä¯Ä±Ä³Äµ]/u,           'j')
       n.gsub!(/[Ä·Ä¸]/u,               'k')
       n.gsub!(/[Å?Ä¾ÄºÄ¼Å?]/u,         'l')
       n.gsub!(/[Ã±Å?Å?Å?Å?Å?]/u,       'n')
       n.gsub!(/[Ã²Ã³Ã´ÃµÃ¶Ã¸ÅÅ?ÅÅ]/u,  'o')
       n.gsub!(/Å?/u,                  'oe')
       n.gsub!(/Ä?/u,                   'q')
       n.gsub!(/[Å?Å?Å?]/u,             'r')
       n.gsub!(/[Å?Å¡Å?ÅÈ?]/u,          's')
       n.gsub!(/[Å¥Å£Å§È?]/u,           't')
       n.gsub!(/[Ã¹ÃºÃ»Ã¼Å«Å¯Å±Å­Å©Å³]/u,'u')
       n.gsub!(/Åµ/u,                   'w')
       n.gsub!(/[Ã½Ã¿Å·]/u,             'y')
       n.gsub!(/[Å¾Å¼Åº]/u,             'z')
       n.gsub!(/\s+/,                   ' ')
       n.gsub!(/[^\sa-z0-9_-]/,          '')
       n
    end
  </code></pre>
  
  <p>Do I need to 'require' a particular library/gem? Or maybe someone could recommend another way to go about this.</p>
  
  <p>I am not using Rails, nor do I plan on doing so.</p>