diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2020-06-03 15:40:01 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2020-06-03 15:51:21 (GMT) |
commit | c540fcaa6bef597aa12f7f2479692eab6bf81d86 (patch) | |
tree | 2f2807c8f5453fd82fe82cb7dccf23ef58f918c1 | |
parent | e237fc65b70212f6ba2d8c163b1ea9bdf7b83e6a (diff) | |
download | CMake-c540fcaa6bef597aa12f7f2479692eab6bf81d86.zip CMake-c540fcaa6bef597aa12f7f2479692eab6bf81d86.tar.gz CMake-c540fcaa6bef597aa12f7f2479692eab6bf81d86.tar.bz2 |
Sphinx/create_identifiers: handle qhp contents as utf-8
-rwxr-xr-x | Utilities/Sphinx/create_identifiers.py | 8 |
1 files 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)) |