指定python3的区域首选编码为utf8

来源 https://stackoverflow.com/questions/31469707/changing-the-locale-preferred-encoding-in-python-3-in-windows
有效代码

import locale
def getpreferredencoding(do_setlocale = True):
    return "utf-8"
locale.getpreferredencoding = getpreferredencoding

你可能感兴趣的:(指定python3的区域首选编码为utf8)