Fixed matchcompiler with Python 3.6 on Windows by using UTF-8 as encoding

This commit is contained in:
PKEuS 2017-01-01 10:27:07 +01:00
parent 4c25e798b1
commit 0236f67454
1 changed files with 2 additions and 2 deletions

View File

@ -588,7 +588,7 @@ class MatchCompiler:
def convertFile(self, srcname, destname, line_directive): def convertFile(self, srcname, destname, line_directive):
self._reset() self._reset()
fin = io.open(srcname, "rt", encoding="us-ascii") fin = io.open(srcname, "rt", encoding="utf-8")
srclines = fin.readlines() srclines = fin.readlines()
fin.close() fin.close()
@ -623,7 +623,7 @@ class MatchCompiler:
if line_directive: if line_directive:
lineno = '#line 1 "' + srcname + '"\n' lineno = '#line 1 "' + srcname + '"\n'
fout = io.open(destname, 'wt', encoding="us-ascii") fout = io.open(destname, 'wt', encoding="utf-8")
fout.write(header + strFunctions + lineno + code) fout.write(header + strFunctions + lineno + code)
fout.close() fout.close()