
8 Jan
2021
8 Jan
'21
1:48 p.m.
On 1/8/21 5:22 AM, 罗勇刚(Yonggang Luo) wrote:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 80: ordinal not in range(128) Can we always reading file in decodetree with utf8 encoding And convert all decodetree to utf8 encoding, and the problem should resolved.
scripts/decodetree.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/decodetree.py b/scripts/decodetree.py index 47aa9caf6d..8c9eb365ac 100644 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -1304,7 +1304,7 @@ def main(): for filename in args: input_file = filename - f = open(filename, 'r') + f = open(filename, 'r', encoding="utf8") parse_file(f, toppat) f.close()
Thanks. Would you like to send a formal patch? r~