Explicitly treat all files as UTF-8.

This commit is contained in:
Stefan Rado
2014-02-16 01:51:37 +01:00
parent 1c13225b19
commit 49cc0bd162
4 changed files with 11 additions and 7 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
import os
import re
import codecs
class Scanner(object):
"""
@@ -29,6 +30,6 @@ class Scanner(object):
Scans provided file and passes its contents to the parser using
parser.Parse method.
"""
with open(path, 'r') as f:
with codecs.open(path, 'r', 'utf-8') as f:
contents = f.read()
parser.Parse(contents)