Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use non-local OS error strings (en-US) #34422

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/libstd/sys/windows/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down