我正在使用以下代码打印(到文件) UTF-8 str :
output.write(currentWord.m_wordHeb)
也试过:
output.write(currentWord.m_wordHeb.encode('utf-8')
并补充说:
import sys
import codecs
sys.stdout = codecs.getwriter('utf8')(sys.stdout)
不断出错......通常是这个:
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-2: character maps to <undefined>
谢谢 !