I am trying to convert unicode to string, but I am getting UnicodeDecodeError. The original issue is related to working with a json return and creating a string, but here is a simplified example:
raw = unicode("Soporté")
print stringUnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 6: ordinal not in range(128)
I have tried the suggestion from here: Rename layer with unsupported signs in a mxd via python?
raw = unicode("Soporté")
string = raw.decode('utf-8')
print string
And here: Write Russian field names to txt
raw = unicode("Soporté")
string = raw.encode('utf-8')
print stringBut I get the same error: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 6: ordinal not in range(128)