From c540fcaa6bef597aa12f7f2479692eab6bf81d86 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 3 Jun 2020 11:40:01 -0400 Subject: Sphinx/create_identifiers: handle qhp contents as utf-8 --- Utilities/Sphinx/create_identifiers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Utilities/Sphinx/create_identifiers.py b/Utilities/Sphinx/create_identifiers.py index f3dbbcc..e35f127 100755 --- a/Utilities/Sphinx/create_identifiers.py +++ b/Utilities/Sphinx/create_identifiers.py @@ -6,12 +6,12 @@ if len(sys.argv) != 2: sys.exit(-1) name = sys.argv[1] + "/CMake.qhp" -f = open(name) +f = open(name, "rb") if not f: sys.exit(-1) -lines = f.read().splitlines() +lines = f.read().decode("utf-8").splitlines() if not lines: sys.exit(-1) @@ -46,5 +46,5 @@ for line in lines: line = part1 + prefix + "id=\"" + domain_object_type + "/" + domain_object + "\" " + part2 newlines.append(line + "\n") -f = open(name, "w") -f.writelines(newlines) +f = open(name, "wb") +f.writelines(map(lambda line: line.encode("utf-8"), newlines)) -- cgit v0.12