-
Notifications
You must be signed in to change notification settings - Fork 74
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
Texts retrieved by FormatMessage on Windows #47
Comments
Since these are all in the same area of code it makes sense to deal with them at once. Thanks, @kubo. |
Node.js uses |
I've pushed a commit that should resolve these issues. Let me know. Thanks! |
Thank you! It solved these issues. |
Thanks, @kubo. I have resolved that logic error as well. Not sure how I missed that! |
Thanks! |
Some issues about FormatMessage used here on Windows
I might have to create separate issues. But some issues are related so I put all in one.
A potential bug
The 6th argument
FormatMessageW
issizeof(wLoadError)
but it should besizeof(wLoadError)/sizeof(wchar_t)
because the argument is the number of characters, not bytes, allocated for the 5th argument.Message is incorrectly stripped on Japanese.
Trailing period and carriage return are stripped here. However, when the last character before carriage return is a multi-byte character, the character is broken. It should be stripped only when it is really period.
Message language
The error message retrieved by
FormatMessageW
depends on the OS language. Could you change the messages to English or add a compile-time option to change it?The message is changed to English when the 4th argument is
MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT)
.Programs in the samples directory print garbled text in Japanese Windows command prompt when OCI.DLL is not found. If the message language is English, it isn't garbled.
Add error number to the message
When the message isn't changed to English, could you add the error number to the message?
For example when the error code is 126:
When an issue is posted with a localized error message and you don't know the language, you cannot read the message. Moreover if it is garbled as messages in Japanese Windows command prompt, nobody read it. If the error number is included in the text, you can know the error as follows.
The text was updated successfully, but these errors were encountered: