title: what is the best way to reliably remove unicode from strings
body: <p>I have a variety of strings that I need to pull the 'TM', '(c)' etc from. These marks are in unicode. Right now I just want to pull all of the unicode out, once I get that working I'll be a little more selective and just pull out the legalese marks. Here's the code: </p>
  
  <pre><code>strings = ['Star Wars \u2122 2', 'Empire Strikes Back\u00C2\u00AE The Strikening',
         "Star Wars\u2122 2", "Empire Strikes Back\u00C2\\u00AE The Strikening"]
  
  p strings.inspect
  
  strings.each { |str|
    sub = str.gsub(/\\(u[(\d)a-fA-F]{4})/, "")
    p sub
  }
  </code></pre>
  
  <p>Results in: </p>
  
  <pre><code>["Star Wars \\u2122 2", "Empire Strikes Back\\u00C2\\u00AE The Strikening", "Star Wars\u2122 2", "Empire Strikes Back\u00C2\\u00AE The Strikening"]
  "Star Wars  2"
  "Empire Strikes Back The Strikening"
  "Star Wars\u2122 2"
  "Empire Strikes Back\u00C2 The Strikening"
  </code></pre>
  
  <p>Works for single quotes, but not double. I understand that single quoted strings behave differently than double quoted strings. The issue here is that the strings that are being fed into this function are behaving as double quoted strings and breaking the code (substitution doesn't happen). I tried adding <code>sub('\\', '\\\\')</code> before the gsub but that didn't fix it. </p>
  
  <p>I think I'm misunderstanding something about how strings behave in Ruby. How can I remove a unicode symbol from <code>"Star Wars\u2122 2"</code> reliably? The regex that I have isn't doing it. </p>
  
  <p>Ruby 1.9.3</p>