unicode text to Japanese text for Rakuten Web service API
Question: Hi I'm using Rakuten Web service API to play around with it in Ipython
Notebook. I successfully loaded the product ranking data using this url
([https://app.rakuten.co.jp/services/api/IchibaItem/Ranking/20120927?format=json&applicationId=1074393356181806125](https://app.rakuten.co.jp/services/api/IchibaItem/Ranking/20120927?format=json&applicationId=1074393356181806125))

My question is that since the Japanese text is unicode, I cannot read the
text. How can I handle this?

Here is my code on Ipython Notebook:

    
    
    import requests
    import urllib2
    url = 'https://app.rakuten.co.jp/services/api/IchibaItem/Ranking/20120927?format=json&page=1&applicationId=1074393356181806125'
    r = requests.get(url)
    res = r.json()
    res['title']
    

Current output for title for example:

    
    
    u'\u3010\u697d\u5929\u5e02\u5834\u3011\u30e9\u30f3\u30ad\u30f3\u30b0\u5e02\u5834 \u3010\u7dcf\u5408\u3011'
    

When I code `print(res['title'])`, I got this error:

    
    
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 0: ordinal not in range(128)
    


Answer: That is the representation of an Unicode string, see
[`repr`](https://docs.python.org/3.5/library/functions.html?highlight=repr#repr).

Just _print_ the actual text instead of showing the representation:

    
    
    print(res['title'])
    

Printing Unicode is tricky however, Eg. for Windows see [Python, Unicode, and
the Windows console](http://stackoverflow.com/questions/5419/python-unicode-
and-the-windows-console).

