title: Convert Excel value from code page 1251 to unicode
body: <p>I'm accesing an Excel thru python to adjust some encoding of the cells. My code so far:</p>
  
  <pre><code>from xlrd import *
  from xlwt import *
  
  wb = open_workbook('a.xls')
  
  s = wb.sheets()[0]
  
  for row in range(s.nrows):
  e = s.cell(row,9).value
  r = s.cell(row,11).value
  print e,' ',r.decode('cp1251')
  </code></pre>
  
  <p>When running this code I get this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\pem\workspace\a\src\a.py", line 17, in &lt;module&gt;
      print e,' ',r.decode('cp1251')
    File "C:\Python27\lib\encodings\cp1251.py", line 15, in decode
      return codecs.charmap_decode(input,errors,decoding_table)
    File "C:\Python27\lib\encodings\cp1251.py", line 12, in encode
      return codecs.charmap_encode(input,errors,encoding_table)
  UnicodeEncodeError: 'charmap' codec can't encode character u'\xf6' in position 23: character maps to &lt;undefined&gt;
  </code></pre>
  
  <p>I know that <strong>e</strong> is english text and <strong>r</strong> is the russian translation in 1251 encoding. </p>