I've developed a plugin for QGIS 2.12 which uses data that is encoded in UTF-8. The plugin works fine for 2.12, but when I try to start it in QGIS 2.14 it throws me the following error:
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 4: ordinal not in range(128)
The code snippet which causes the exception is
value = QLabel(str(feature[field]).decode('utf-8')).
In former cases the error was thrown because I forgot to decode the characters, but I do convert them in that case. I already tried to remove the
str() and the
.decode('utf-8') calls, but the exception still gets thrown.
Why does this work for QGIS Lyon but not for QGIS Essen?