title: Converting Docx to pure text
body: <p>I am trying to convert docx files to text but keep getting an error. I am using python 2-7</p>
  
  <pre><code>import docx
  
  def getText(filename):
      doc = docx.Document(filename)
      fullText = []
      for para in doc.paragraphs:
          fullText.append(para.text)
      return '\n'.join(fullText)
  </code></pre>
  
  <p>Traceback:</p>
  
  <pre><code>return codecs.charmap_encode(input,errors,encoding_map)
  UnicodeEncodeError: 'charmap' codec can't encode character u'\u2019' in position 764: character maps to &lt;undefined&gt;
  </code></pre>