ElementTree и Unicode
У меня есть этот символ в файле XML:
<data>
<products>
<color>fumè</color>
</product>
</data>
Я пытаюсь сгенерировать экземпляр ElementTree со следующим кодом:
string_data = open('file.xml')
x = ElementTree.fromstring(unicode(string_data.encode('utf-8')))
и я получаю следующую ошибку:
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe8' in position 185: ordinal not in range(128)
(NOTE: The position is not exact, I sampled the xml from a larger one).
Как это решить? Спасибо