Using python 2.7, I have an endpoint which is returning strings containing the characters '\u2019', '\u2018', and '\u2026'. I haven't been able to resolve these with any combination of encoding, decoding, etc.
The actual strings are something like the following: "\u2018Ralph Breaks the Internet\u2019 and \u2018Creed II\u2019 Are Thanksgiving Hits"
Here is a code snippet
#!/usr/bin/python
# -*- coding: utf-8 -*-
...
>>> '\u2019'.encode('ascii')
'\\u2019'
>>> '\u2019'.encode('utf-8')
'\\u2019'
>>> '\u2019'.decode('utf-8')
u'\\u2019'
>>>'\u2019'.decode('ascii')
u'\\u2019'
I am running command line, but have also tried to output to files to no avail. There are many similar threads on these types of issues, but haven't found one that works for this. I think I could do some sort of regex character lookup and substitution, but that seems clunky.