commit 63ceadb485f6618da99e8a3b7822ede8da27989d Author: Nick Mathewson nickm@torproject.org Date: Fri Jul 7 13:11:18 2017 -0400
Use LANG_ENGLISH in windows error messages
This change prevents us from generating corrupt messages when we are confused about codepage settings, and makes Windows errors consistent with the rest of our logs.
Fixes bug 22520; bugfix on 0.1.2.8-alpha. Patch from "Vort". --- changes/bug22520 | 5 +++++ src/common/compat.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/changes/bug22520 b/changes/bug22520 new file mode 100644 index 0000000..cc14f72 --- /dev/null +++ b/changes/bug22520 @@ -0,0 +1,5 @@ + o Minor bugfixes (error reporting, windows): + - When formatting Windows error messages, use the English format + to avoid codepage issues. Fixes bug 22520; bugfix on + 0.1.2.8-alpha. Patch from "Vort". + diff --git a/src/common/compat.c b/src/common/compat.c index 3bea626..4d110ab 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -3261,7 +3261,7 @@ format_win32_error(DWORD err) FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT), (LPVOID)&str, 0, NULL);