diff options
author | Damien George <damien.p.george@gmail.com> | 2019-04-12 11:34:52 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-04-12 11:34:52 +1000 |
commit | 673e154dfef6aef827b86ea177c211269358b282 (patch) | |
tree | 087412b342bfb18af0e7d101b73a737117c90fe8 /py/makeqstrdefs.py | |
parent | fd112239d6b7e6ebeb78f62e3b02aa6640a88772 (diff) | |
download | micropython-673e154dfef6aef827b86ea177c211269358b282.tar.gz micropython-673e154dfef6aef827b86ea177c211269358b282.zip |
py/makedefs: Use io.open with utf-8 encoding when processing source.
In case (user) source code contains utf-8 encoded data and the default
locale is not utf-8.
See #4592.
Diffstat (limited to 'py/makeqstrdefs.py')
-rw-r--r-- | py/makeqstrdefs.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/py/makeqstrdefs.py b/py/makeqstrdefs.py index 176440136d..457bdeef65 100644 --- a/py/makeqstrdefs.py +++ b/py/makeqstrdefs.py @@ -9,6 +9,7 @@ from __future__ import print_function import re import sys +import io import os # Blacklist of qstrings that are specially handled in further @@ -108,7 +109,7 @@ if __name__ == "__main__": pass if args.command == "split": - with open(args.input_filename) as infile: + with io.open(args.input_filename, encoding='utf-8') as infile: process_file(infile) if args.command == "cat": |