diff --git a/mesonbuild/utils/vsenv.py b/mesonbuild/utils/vsenv.py index 3c2687884de2..e9a5c1072e02 100644 --- a/mesonbuild/utils/vsenv.py +++ b/mesonbuild/utils/vsenv.py @@ -6,6 +6,7 @@ import pathlib import shutil import tempfile +import locale from .. import mlog from .universal import MesonException, is_windows, windows_detect_native_arch @@ -92,7 +93,8 @@ def _setup_vsenv(force: bool) -> bool: bat_file.write(bat_contents) bat_file.flush() bat_file.close() - bat_output = subprocess.check_output(bat_file.name, universal_newlines=True) + bat_output = subprocess.check_output(bat_file.name, universal_newlines=True, + encoding=locale.getpreferredencoding(False)) os.unlink(bat_file.name) bat_lines = bat_output.split('\n') bat_separator_seen = False