I'm using BeautifulSoup, and I get back a string like this:
u'Dassault Myst\xe8re'
It's a unicode, but what I want is to make it look like:
'Dassault Mystère'
I have tried
name = name.encode('utf-8'), decode(), unicode()
The error I keep getting is:
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe8'
My default encoding seems to be 'ascii': sys.getdefaultencoding() returns 'ascii' even though I have:
#!/usr/bin/env python
# encoding: utf-8
At the top of the file.
Hoping to solve this recurring Unicode issue once and for all!
Thanks