How to decode a unicode string Python

That string already is decoded (it's a Unicode object). You need to encode it if you want to store it in a file (or send it to a dumb terminal etc.).

Generally, when working with Unicode, you should (in Python 2) decode all your strings early in the workflow (which you already seem to have done; many libraries that handle internet traffic will already do that for you), then do all your work on Unicode objects, and then at the very end, when writing them back, encode them to whatever encoding you're using.


You need to call encode function and not decode function, as item is already decoded.

Like this:

decoded_value = item.encode('utf-8')