It is a small story.
test.py
line = 'Today's weather is sunny'
NG_example = line.strip() # 'Today's weather is sunny'
OK_example = unicode(line).strip() # u'Today's weather is sunny'
OK_example2 = line.decode('utf-8').strip().encode('utf-8') # 'Today's weather is sunny'
Recommended Posts