title: Removing special characters (¡) from a string
body: <p>I am trying to write into a file from a collection. The collection has special characters like ¡ which create a problem. For example the content in the collection has details like: </p>
  
  <blockquote>
    <p>{..., Name: ¡Hi!, ...}</p>
  </blockquote>
  
  <p>Now I am trying to write the same into a file but I get the error </p>
  
  <pre><code>UnicodeEncodeError: 'ascii' codec can't encode character u'\xa1' in position 0: ordinal not in range(128)
  </code></pre>
  
  <p>I have tried the using the solutions provided <a href="https://stackoverflow.com/questions/5109970/linux-python-encoding-a-unicode-string-for-print">here</a> but in vain. It will be great if someone could help me with this :) </p>
  
  <p>So the example goes like this: </p>
  
  <p>I have a collection which has the following details</p>
  
  <pre><code>{ "_id":ObjectId("5428ead854fed46f5ec4a0c9"), 
     "author":null,
     "class":"culture",
     "created":1411967707.356593,
     "description":null,
     "id":"eba9b4e2-900f-4707-b57d-aa659cbd0ac9",
     "name":"¡Hola!",
     "reviews":[
  
     ],
     "screenshot_urls":[
  
     ]
  }
  </code></pre>
  
  <p>Now I try to access the <code>name</code> entry here from the collection and I do that by iterating it over the collection i.e. </p>
  
  <pre><code>f = open("sample.txt","w");
  
  for val in exampleCollection:
     f.write("%s"%str(exampleCollection[val]).encode("utf-8"))
  
  f.close();
  </code></pre>