UnicodeEncodeError: ascii codec cant encode character u\u65e0 in position 1: ordinal not in range(128)

 UnicodeEncodeError: 'ascii' codec can't encode character u'u65e0' in position 1: ordinal not in range(128)上述问题解决办法修改tool.pys = json.dumps(obj, sort_keys=True, indent=4, ensure_ascii=False)
        outfile.write(codecs.encode(s, 'utf-8'))修改后修改前 

相关内容推荐