build: Explicitly read files as UTF-8

Otherwise the OS default encoding is used which leads to errors on Windows.
This commit is contained in:
David Kellner 2021-10-17 17:05:51 +02:00
parent bed8eb27a8
commit b9714440a6

View file

@ -20,7 +20,7 @@ re_keyval = re.compile(r'^[\s\*/]+@(\S+)\s+(.+)\s*$', re.IGNORECASE)
items = list()
for jsfilename in sorted(glob.glob('*.user.js')):
in_header = False
with open(jsfilename) as jsfile:
with open(jsfilename, encoding='utf-8') as jsfile:
d = defaultdict(list)
for line in jsfile:
if not in_header and re_start_header.search(line):