title: UnicodeEncodeError Google App Engine
body: <p>I am getting the very familiar:</p>
  
  <p>UnicodeEncodeError: 'ascii' codec can't encode character u'\xe8' in position 24: ordinal not in range(128)</p>
  
  <p>I have checked out multiple posts on SO and they recommend -  variable.encode('ascii', 'ignore') </p>
  
  <p>however, this is not working. Even after this I am getting the same error ... </p>
  
  <p>The stack trace:</p>
  
  <pre><code>'ascii' codec can't encode character u'\x92' in position 18: ordinal not in range(128)
  Traceback (most recent call last):
    File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 513, in __call__
      handler.post(*groups)
    File "/base/data/home/apps/autominer1/1.343038273644030157/siteinfo.py", line 2160, in post
      imageAltTags.append(str(image["alt"]))
  UnicodeEncodeError: 'ascii' codec can't encode character u'\x92' in position 18: ordinal not in range(128)
  </code></pre>
  
  <p>The code responsible for the same:</p>
  
  <pre><code>siteUrl = urlfetch.fetch("http://www."+domainName, headers = { 'User-Agent' : 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5' } )
  
  
   webPage = siteUrl.content.decode('utf-8', 'replace').encode('ascii', 'replace')
  
  
   htmlDom = BeautifulSoup(webPage)
  
   imageTags = htmlDom.findAll('img', { 'alt' : True } )
  
  
   for image in imageTags :
                          if len(image["alt"]) &gt; 3 :
                                  imageAltTags.append(str(image["alt"]))
  </code></pre>
  
  <p>Any help would be greatly appreciated. thanks. </p>