String value decode utf-8

Viewed 1350

I want to decode string values ​​to utf-8. But it doesn't change. So, here is my code:

self.textEdit_3.append(str(self.new_header).decode("utf-8") + "\n")

The result image is here:

enter image description here

The original output value is:

['matchkey', 'a', 'b', 'd', '안녕'] # 안녕 is Korean Language

I changed the default encoding for encoding / decoding with unicode to utf-8 instead of ascii. On the first line I added this code:

import sys
reload(sys)
sys.setdefaultencoding('utf-8')

Why doesn't the string value change?

enter image description here

1 Answers
Related