title: How to convert escaped characters?
body: <p>I want to convert strings containing escaped characters to their normal form, the same way Python's lexical parser does:</p>
  
  <pre><code>&gt;&gt;&gt; escaped_str = 'One \\\'example\\\''
  &gt;&gt;&gt; print(escaped_str)
  One \'Example\'
  &gt;&gt;&gt; normal_str = normalize_str(escaped_str)
  &gt;&gt;&gt; print(normal_str)
  One 'Example'
  </code></pre>
  
  <p>Of course the boring way will be to replace all known escaped characters one by one:
  <a href="http://docs.python.org/reference/lexical_analysis.html#string-literals" rel="noreferrer">http://docs.python.org/reference/lexical_analysis.html#string-literals</a></p>
  
  <p>How would you implement <code>normalize_str()</code> in the above code?</p>