title: How to replace all '0xa0' chars with a ' ' in a bunch of text files?
body: <p>i've been trying to mass-edit a bunch of text files to utf-8 in python and this error keeps popping out. is there a way to replace them in some python scrips or bash commands?
  i used the code:</p>
  
  <pre><code>writer = codecs.open(os.path.join(wrd, 'dict.en'), 'wtr', 'utf-8')
  for infile in glob.glob(os.path.join(wrd,'*.txt')):
          print infile
          for line in open(infile):
                  writer.write(line.encode('utf-8'))
  </code></pre>
  
  <p>and got these sorts of errors:</p>
  
  <pre><code>Traceback (most recent call last):
    File "dicting.py", line 30, in &lt;module&gt;
      writer.write(line2.encode('utf-8'))
  UnicodeDecodeError: 'utf8' codec can't decode byte 0xa0 in position 216: unexpected code byte
  </code></pre>