I am using an API in Python v2.7 to obtain a string, the content of which is unknown. The content can be in English, German or French. The variable name assigned to the returned string is 'category'. An example of a returned value for the variable category is:-
"temp\\u00eate de poussi\\u00e8res"
I have tried category.decode('utf-8')
to decode the string into, in the above case, French, but unfortunately it still returns the same value, with an additional unicode 'u' at the beginning when I print the result of category.decode('utf-8')
.
u'"temp\\u00eate de poussi\\u00e8res'
I also tried category.encode('utf-8')
but it returns the same value (minus the 'u' that precedes the string:-
'"temp\\u00eate de poussi\\u00e8res"'
Any suggestions?