From 37a8f94e00051358319923f4ba2fbf4955b1c414 Mon Sep 17 00:00:00 2001 From: Liigo Date: Thu, 23 Jun 2016 13:52:38 +0800 Subject: [PATCH] Use non-local OS error strings (en-US) Closes #34318 --- src/libstd/sys/windows/os.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libstd/sys/windows/os.rs b/src/libstd/sys/windows/os.rs index 32ca32e76cb62..b00e3438990c5 100644 --- a/src/libstd/sys/windows/os.rs +++ b/src/libstd/sys/windows/os.rs @@ -37,8 +37,10 @@ pub fn errno() -> i32 { /// Gets a detailed string description for the given error number. pub fn error_string(errnum: i32) -> String { // This value is calculated from the macro - // MAKELANGID(LANG_SYSTEM_DEFAULT, SUBLANG_SYS_DEFAULT) - let langId = 0x0800 as c::DWORD; + // MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US) + // Don't use system default language id here, since localization strings + // may be escaped, and result in unreadable output. CC #34318. + let langId = 0x0409 as c::DWORD; let mut buf = [0 as c::WCHAR; 2048];