title: UnicodeDecodeError: 'ascii' codec can't encode character u'\u2019'
body: <p>I keep getting the below error and can't seem to get <code>.encode('ascii', errors='ignore')</code> to work. </p>
  
  <pre><code>eqs = soup.find_all('div', {'style': 'margin:7px 5px 0px;vertical-align:top;text-align:center;display:inline-block;line-height:normal;width:120px;'})
  
  for equipment in eqs:
      if '#b0c3d9' in str(equipment):
          f2.write(equipment.getText() + ', Common\n')
      if '#5e98d9' in str(equipment):
          f2.write(equipment.getText() + ', Uncommon\n')
      if '#4b69ff' in str(equipment):
          f2.write(equipment.getText() + ', Rare\n')
      if '#8847ff' in str(equipment):
          f2.write(equipment.getText() + ', Mythical\n')
      if '#b28a33' in str(equipment):
          f2.write(equipment.getText() + ', Immortal\n')
      if '#d32ce6' in str(equipment):
          f2.write(equipment.getText() + ', Legendary\n')
      if '#eb4b4b' in str(equipment):
          f2.write(equipment.getText() + ', Ancient\n')
      if '#ade55c' in str(equipment):
          f2.write(equipment.getText() + ', Arcana\n')
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>f2.write(equipment.getText().encode('ascii', errors='ignore'))
  </code></pre>
  
  <p>and</p>
  
  <pre><code>f2.write(equipment.encode('ascii', errors='ignore').getText())
  </code></pre>
  
  <p>As well as some other things I am ashamed to post. Such as running it through the file that BeautifulSoup would later read from, but that just throws a different error. Thanks again for helping.</p>
  
  <p>full traceback:</p>
  
  <pre><code>Traceback (most recent call last):
   File "&lt;pyshell#285&gt;", line 1, in &lt;module&gt;
    import D2soup1
   File "D2soup1.py", line 86, in &lt;module&gt;
    test()
   File "D2soup1.py", line 30, in test
    f2.write(equipment.getText() + ', Immortal\n')
  UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 5:     ordinal not in range(128)
  </code></pre>
  
  <p>I am using string to parse out the box-shadow from the below html. I know it is probably not the best practice, but it was the only way I could think to grab it. Still new to BeautifulSoup.</p>
  
  <pre><code>&lt;div style="margin:7px 5px 0px;vertical-align:top;text-align:center;display:inline-block;line-height:normal;width:120px;"&gt;&lt;div style="margin-bottom: 5px;box-shadow:0px 0px 2px 4px #5e98d9;"&gt;&lt;a href="/Pirate_Slayer%27s_Tricorn" title="Pirate Slayer's Tricorn"&gt;&lt;img alt="Pirate Slayer's Tricorn" src="http://hydra-media.cursecdn.com/dota2.gamepedia.com/thumb/7/79/Pirate_Slayer%27s_Tricorn.png/120px-Pirate_Slayer%27s_Tricorn.png" width="120" height="80" srcset="http://hydra-media.cursecdn.com/dota2.gamepedia.com/thumb/7/79/Pirate_Slayer%27s_Tricorn.png/180px-Pirate_Slayer%27s_Tricorn.png 1.5x, http://hydra-media.cursecdn.com/dota2.gamepedia.com/thumb/7/79/Pirate_Slayer%27s_Tricorn.png/240px-Pirate_Slayer%27s_Tricorn.png 2x"&gt;&lt;/a&gt;&lt;/div&gt;
  </code></pre>