title: How to remove extended ascii using python?
body: <p>In trying to fix up a PML (Palm Markup Language) file, it appears as if my test file has non-ASCII characters which is causing MakeBook to complain. The solution would be to strip out all the non-ASCII chars in the PML.</p>
  
  <p>So in attempting to fix this in python, I have</p>
  
  <pre><code>import unicodedata, fileinput
  
  for line in fileinput.input():
      print unicodedata.normalize('NFKD', line).encode('ascii','ignore')
  </code></pre>
  
  <p>However, this results in an error that line must be "unicode, not str". Here's a file fragment.</p>
  
  <pre><code>\B1a\B \tintense, disordered and often destructive rage†.†.†.\t
  </code></pre>
  
  <p>Not quite sure how to properly pass line in to be processed at this point. </p>