Make Err_win_error return English messages English messages are hopefully strictly ASCII. Passing 0 as language id may return a non-English message using the current code page and resulting in invalid UTF-8.
See LUCY-311. Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/b92bf137 Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/b92bf137 Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/b92bf137 Branch: refs/heads/master Commit: b92bf137efbe775d09180b68c885b678667d8c66 Parents: ae83c3e Author: Nick Wellnhofer <[email protected]> Authored: Sat Oct 8 16:44:57 2016 +0200 Committer: Nick Wellnhofer <[email protected]> Committed: Sun Oct 9 13:36:19 2016 +0200 ---------------------------------------------------------------------- runtime/core/Clownfish/Err.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/b92bf137/runtime/core/Clownfish/Err.c ---------------------------------------------------------------------- diff --git a/runtime/core/Clownfish/Err.c b/runtime/core/Clownfish/Err.c index 82daf02..7ca59b8 100644 --- a/runtime/core/Clownfish/Err.c +++ b/runtime/core/Clownfish/Err.c @@ -254,7 +254,8 @@ Err_win_error() { DWORD message_len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, // message source table GetLastError(), - 0, // language id + MAKELANGID(LANG_ENGLISH, + SUBLANG_ENGLISH_US), buf, buf_size, NULL // empty va_list
