From 89033cd1e856e818c68572157664dc851a10a74e Mon Sep 17 00:00:00 2001 From: JunGe-Y <59342201+JunGe-Y@users.noreply.github.com> Date: Thu, 14 Nov 2024 06:55:57 +0800 Subject: [PATCH] compat: Fix compilation when using non-UTF-8 locales (#1122) --- compat/build.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compat/build.py b/compat/build.py index 524a6bac4..4681e8561 100644 --- a/compat/build.py +++ b/compat/build.py @@ -4,6 +4,7 @@ from collections import OrderedDict from dataclasses import dataclass, field import itertools +import locale import os from pathlib import Path import pickle @@ -400,7 +401,7 @@ def call_internal_meson(argv, *args, **kwargs): **kwargs, "stdout": subprocess.PIPE, "stderr": subprocess.STDOUT, - "encoding": "utf-8", + "encoding": locale.getpreferredencoding(), } else: silenced_kwargs = kwargs