Просмотр исходного кода

Fix generators py-scripts to use UTF-8

Fix generators py-scripts to use UTF-8
fdb604a98b1deb6c0f03822b584b1cc0ec5e6b2a
dimdim11 8 месяцев назад
Родитель
Сommit
b9f9cd42cc

+ 1 - 1
build/export_generators/cmake/build/scripts/generate_vcs_info.py

@@ -315,5 +315,5 @@ def get_version_info(arc_root, custom_version=""):
 
 
 if __name__ == '__main__':
-    with open(sys.argv[1], 'w') as f:
+    with open(sys.argv[1], 'wt', encoding="utf-8") as f:
         f.write(get_version_info(sys.argv[2]))

+ 2 - 2
build/export_generators/cmake/build/scripts/re_replace.py

@@ -23,7 +23,7 @@ def main(args: List[str]):
     skipped_files = []
     for file in files:
         patched = False
-        with open(file, 'r') as f:
+        with open(file, 'rt', encoding="utf-8") as f:
             lines = f.readlines()
             for i in range(len(lines)):
                 line = lines[i]
@@ -32,7 +32,7 @@ def main(args: List[str]):
                     patched = True
                     lines[i] = patched_line
         if patched:
-            with open(file, 'w') as f:
+            with open(file, 'wt', encoding="utf-8") as f:
                 f.writelines(lines)
             patched_files.append(file)
         else:

+ 1 - 1
build/export_generators/hardcoded-cmake/build/scripts/generate_vcs_info.py

@@ -315,5 +315,5 @@ def get_version_info(arc_root, custom_version=""):
 
 
 if __name__ == '__main__':
-    with open(sys.argv[1], 'w') as f:
+    with open(sys.argv[1], 'wt', encoding="utf-8") as f:
         f.write(get_version_info(sys.argv[2]))

+ 2 - 2
build/export_generators/hardcoded-cmake/build/scripts/re_replace.py

@@ -23,7 +23,7 @@ def main(args: List[str]):
     skipped_files = []
     for file in files:
         patched = False
-        with open(file, 'r') as f:
+        with open(file, 'rt', encoding="utf-8") as f:
             lines = f.readlines()
             for i in range(len(lines)):
                 line = lines[i]
@@ -32,7 +32,7 @@ def main(args: List[str]):
                     patched = True
                     lines[i] = patched_line
         if patched:
-            with open(file, 'w') as f:
+            with open(file, 'wt', encoding="utf-8") as f:
                 f.writelines(lines)
             patched_files.append(file)
         else:

+ 1 - 1
build/scripts/generate_vcs_info.py

@@ -315,5 +315,5 @@ def get_version_info(arc_root, custom_version=""):
 
 
 if __name__ == '__main__':
-    with open(sys.argv[1], 'w') as f:
+    with open(sys.argv[1], 'wt', encoding="utf-8") as f:
         f.write(get_version_info(sys.argv[2]))

+ 2 - 2
build/scripts/re_replace.py

@@ -23,7 +23,7 @@ def main(args: List[str]):
     skipped_files = []
     for file in files:
         patched = False
-        with open(file, 'r') as f:
+        with open(file, 'rt', encoding="utf-8") as f:
             lines = f.readlines()
             for i in range(len(lines)):
                 line = lines[i]
@@ -32,7 +32,7 @@ def main(args: List[str]):
                     patched = True
                     lines[i] = patched_line
         if patched:
-            with open(file, 'w') as f:
+            with open(file, 'wt', encoding="utf-8") as f:
                 f.writelines(lines)
             patched_files.append(file)
         else: