First, please acknowledge that what you've got from the API are not (quote from you) Unicode characters. To be technically precise, those sequence of characters are HTML character references, also known as HTML entities.
The behavior you've encountered is a well-known issue of the API, for which there's no other solution that I know of, except that you yourself have to substitute those HTML entities for the actual characters that they stand for.
In the context of Python 3, you could very well use the function html.unescape
that is part of html
module:
import html
print(html.unescape(title))
This code will produce Nurse's
when title
is Nurse's
.
For what concerns your output R\u00f6yksopp
, please post the code context that queries the API, for to see why the \uXXXX
escape sequences are not processed properly by your program. You may also post the video ID that produced this output, for to check that myself.