python convert unicode into it's "print" form
Question: I grabbed this paragraph in a webpage:

> It doesn’t look like a controversial new case management system is going
> anywhere. So the city plans to spend the next few months helping local
> social assistance workers learn to live with it.

and in my downloaded html data in python unicode it looks like this:

    
    
    mystr = u'It doesn\u2019t look lake a controversial new case management system is going anywhere. So\xa0the city plans to spend the next few months helping local social assistance workers learn to live with it.'
    

my plan is to be able to use something like `mystr.find("doesn't")` to find
the location of the word. Currently, the `mystr.find("doesn't")` will return
`-1` as it is actually `doesn\u2019t` in `mystr`

Is there a fast way to convert `mystr` to exactly what the paragraph looked
like above, so that all unicode 'characters' are replaced by 'normal'
characters so that I can use `str.find()`?

The best posts I've found on the webpage so far is to replace the `u'\u2019'`
with `"'"` and then replace `u'\xa0'` with `' '`. Is there are more convenient
method so that I don't have to really write a method and build a conversion
dictionary?

ps:

I've also tried unicodedata.normalizing and stuff like that, doesn't seem to
work.

EDIT: I forgot to mention, the python version is 2.7


Answer: You already have what the webpage contains. `\u2019` is [U+2019 RIGHT SINGLE
QUOTATION MARK](http://codepoints.net/U+2019), a _fancy_ single quote, but you
are using a simple ASCII single quote instead, e.g. the lowly [U+0027
APOSTROPHE](http://codepoints.net/U+0027).

If you print the value, you'll see it produces something that looks a lot like
it has a singe quote in it, but slightly _curved_ :

    
    
    >>> mystr = u'It doesn\u2019t look lake a controversial new case management system is going anywhere. So\xa0the city plans to spend the next few months helping local social assistance workers learn to live with it.'
    >>> print mystr
    It doesn’t look lake a controversial new case management system is going anywhere. So the city plans to spend the next few months helping local social assistance workers learn to live with it.
    

All Python did was echo the _representation_ of the string, which replaces
anything non-printable and non-ASCII with escape sequences that make the value
_reproducible_ ; you can copy and paste the value into any Python interpreter
or script and it'll produce the same value. Because the default source
encoding for Python is ASCII only ASCII characters are used to describe the
value.

You could look for that text instead:

    
    
    >>> u'doesn\u2019t' in mystr
    True
    

or you could use a library like
[`unidecode`](http://pypi.python.org/pypi/unidecode) to replace non-ASCII
codepoints with ASCII 'lookalikes'; it'll replace the fancy quote with a plain
ASCII quote:

    
    
    >>> from unidecode import unidecode
    >>> unidecode(mystr)
    "It doesn't look lake a controversial new case management system is going anywhere. So the city plans to spend the next few months helping local social assistance workers learn to live with it."
    >>> "doesn't" in unidecode(mystr)
    True
    

