encoding = "ascii" # line 35 if sys.platform == 'win32': # On Windows, we could use "mbcs". However, to give the user # a portable encoding name, we need to find the code page try: encoding = locale.getdefaultlocale()[1] codecs.lookup(encoding) except LookupError: pass encoding = 'utf-8' ## <- this line force the encoding to utf-8.