From fde1a239c92b770244ebc130cad488aa774d77be Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Fri, 2 Jun 2023 14:27:53 +0200 Subject: [PATCH] scripts: snippets: Use UTF-8 to write CMake files UTF-8 is not always the default encoding on some platforms, but it's the only reliable way to store encoded strings for filenames using non-ASCII characters. Signed-off-by: Carles Cufi --- scripts/snippets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/snippets.py b/scripts/snippets.py index 58a2d6cf6bc..878c0c25fc4 100644 --- a/scripts/snippets.py +++ b/scripts/snippets.py @@ -311,7 +311,7 @@ def write_cmake_out(snippets: Snippets, cmake_out: Path) -> None: detail and are not meant to be used outside of snippets.cmake.''' if not cmake_out.parent.exists(): cmake_out.parent.mkdir() - with open(cmake_out, 'w') as f: + with open(cmake_out, 'w', encoding="utf-8") as f: SnippetToCMakePrinter(snippets, f).print_cmake() def main():