diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 4043f3a8c28..7aea96f5b21 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -438,7 +438,7 @@ def configure_msvc(env: "SConsEnvironment", vcvars_msvc_config): if not caught and (is_cl and re_cl_capture.match(line)) or (not is_cl and re_link_capture.match(line)): caught = True try: - with open(capture_path, "a", encoding=sys.stdout.encoding) as log: + with open(capture_path, "a", encoding="utf-8") as log: log.write(line + "\n") except OSError: print_warning(f'Failed to log captured line: "{line}".')