title: What is the fastest way to iterate over a Unicode string and replace characters in Cython?
body: <p>I want to iterate over gigabytes of text and replace some characters. It is a very heavy text normalizer with hunderds of replacement candidates. </p>
  
  <p>With python, it would take days to do the task of reading the file line by line and character by character and do the replacements using a dictionary. I am therefore looking forward to Cython to speed up the task for me, as with C++ I get 60+ times speed boost.</p>
  
  <p>So, I have a huge amount of <strong>Unicode</strong> strings:</p>
  
  <pre><code>strings = ['AAAABBACCDDDD', 'ACCBDBCCCCDA', 'ABCAD', 'ABCCCCCCCC']
  </code></pre>
  
  <p>and I want to itreate over them character by character and perform some repalcements:</p>
  
  <pre><code>A -&gt; G
  C -&gt; G
  D -&gt; B
  </code></pre>
  
  <p>The mapping list is of length 1000+. Please also bear in mind that the strings are in Unicode and contain hundreds of unique non-standard characters from different languages.</p>