title: How to convert a string from CP-1251 to UTF-8?
body: <p>I'm using mutagen to convert ID3 tags data from <a href="https://en.wikipedia.org/wiki/Windows-1251" rel="noreferrer">CP-1251</a>/<a href="https://en.wikipedia.org/wiki/Windows-1252" rel="noreferrer">CP-1252</a> to UTF-8. In Linux there is no problem. But on Windows, calling <a href="http://wxpython.org/Phoenix/docs/html/TextEntry.html#TextEntry.SetValue" rel="noreferrer"><code>SetValue()</code></a> on a wx.TextCtrl produces the error:</p>
  
  <blockquote>
    <p>UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
    0: ordinal not in range(128)</p>
  </blockquote>
  
  <p>The original string (assumed to be CP-1251 encoded) that I'm pulling from <a href="http://code.google.com/p/mutagen/" rel="noreferrer">mutagen</a> is:</p>
  
  <pre><code>u'\xc1\xe5\xeb\xe0\xff \xff\xe1\xeb\xfb\xed\xff \xe3\xf0\xee\xec\xf3'
  </code></pre>
  
  <p>I've tried converting this to UTF-8:</p>
  
  <pre><code>dd = d.decode('utf-8')
  </code></pre>
  
  <p>...and even changing the default encoding from ASCII to UTF-8:</p>
  
  <pre><code>sys.setdefaultencoding('utf-8')
  </code></pre>
  
  <p>...But I get the same error.</p>