-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Windows error message has wrong encoding #319
Comments
In error.c in openvpn we have
This will call the ANSI version and return "message" using the current code page while the implicit assumption is that all strings are unicode in utf-8 encoding. I think we should call |
cron2
pushed a commit
that referenced
this issue
May 4, 2023
- We assume that all text passed to the management interface and written to log file are in Unicode (UTF-8). This is broken by the use of the ANSI version of FormatMessage() for Windows error messages. Fix by using FormatMessageW() and converting the UTF-16 result to UTF-8. v2: assign return value of FormatMessageW() to DWORD, not int Github: fixes #319 Signed-off-by: Selva Nair <[email protected]> Acked-by: Frank Lichtenheld <[email protected]> Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg26598.html Signed-off-by: Gert Doering <[email protected]> (cherry picked from commit fed6764)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Originally posted by @mastezont in OpenVPN/openvpn-gui#491 (comment)
Windows 7, OpenVPN version 2.6.3, OpenVPN GUI 11.41.0.0, OS language and OpenVPN GUI Russian. In the "display status" window, part of the message in Russian with the wrong character set (highlighted in the screenshot). If you select "show log" and open it in Notepad++, it shows character set Cyrillic Macintosh instead of the usual Cyrillic Windows-1251, while the word "Элемент" is displayed incorrectly as "Ёлемент" (highlighted in the screenshot).
This error has appeared since version 2.6.0, if memory serves me correctly.
Originally posted by @mastezont in OpenVPN/openvpn-gui#491 (comment)
The text was updated successfully, but these errors were encountered: