Skip to content

Commit 37a8f94

Browse files
committed
Use non-local OS error strings (en-US)
Closes rust-lang#34318
1 parent 6dcc2c1 commit 37a8f94

File tree

1 file changed

+4
-2
lines changed
  • src/libstd/sys/windows

1 file changed

+4
-2
lines changed

src/libstd/sys/windows/os.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ pub fn errno() -> i32 {
3737
/// Gets a detailed string description for the given error number.
3838
pub fn error_string(errnum: i32) -> String {
3939
// This value is calculated from the macro
40-
// MAKELANGID(LANG_SYSTEM_DEFAULT, SUBLANG_SYS_DEFAULT)
41-
let langId = 0x0800 as c::DWORD;
40+
// MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)
41+
// Don't use system default language id here, since localization strings
42+
// may be escaped, and result in unreadable output. CC #34318.
43+
let langId = 0x0409 as c::DWORD;
4244

4345
let mut buf = [0 as c::WCHAR; 2048];
4446

0 commit comments

Comments
 (0)