From f9b31ddaaa81b63c2f3be325aa879796703e5a18 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Thu, 21 May 2020 08:37:44 +0430 Subject: [PATCH] [build] State encoding explicitly for hb-version.h.in As https://circleci.com/gh/harfbuzz/harfbuzz/140481 Traceback (most recent call last): File "./gen-hb-version.py", line 14, in output_file.write (input_file.read () File "/usr/lib/python3.4/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 16: ordinal not in range(128) --- src/gen-hb-version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gen-hb-version.py b/src/gen-hb-version.py index e54132bc9..70e69d8b6 100755 --- a/src/gen-hb-version.py +++ b/src/gen-hb-version.py @@ -10,7 +10,7 @@ major, minor, micro = version.split (".") input = sys.argv[2] output = sys.argv[3] -with open (output, "wb") as output_file, open (input, "r") as input_file: +with open (output, "wb") as output_file, open (input, "r", encoding='utf-8') as input_file: output_file.write (input_file.read () .replace ("@HB_VERSION_MAJOR@", major) .replace ("@HB_VERSION_MINOR@", minor)