-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Encode Win32 error messages in UTF-8. (#3987)
Currently, Win32 error messages are retrieved using the `FormatMessageA` API, which returns them in ANSI encoding. This results in corrupted error messages when the computer's language is other than English. With this PR, we use `FormatMessageW` which returns the message in UTF-16 encoding, which then gets converted to UTF-8 and stored in the encoding-agnostic `std::string`. __Before__ ![image](https://user-images.githubusercontent.com/12659251/226977534-68f56838-6e9c-4e04-92ce-ae0824ef7c56.png) __After__ ![image](https://user-images.githubusercontent.com/12659251/226977191-6c024bc4-99c3-4d91-b28b-5a3407038da4.png) __After, if the console's output mode is set to UTF-8__ ![image](https://user-images.githubusercontent.com/12659251/226976565-6f0670f7-9f4b-4cd0-ab53-b542f79522cf.png) The C# API (at least, don't know about the others) needs to be updated to support incoming UTF-8 strings from the Core. IIRC, POSIX works in UTF-8 by default so it doesn't need any changes, right? [SC-26131](https://app.shortcut.com/tiledb-inc/story/26131/win32-vfs-error-messages-in-greek-are-corrupted) --- TYPE: IMPROVEMENT DESC: Encode Win32 error messages in UTF-8. --------- Co-authored-by: KiterLuc <[email protected]> (cherry picked from commit b8ec44f)
- Loading branch information
1 parent
f5a3e5e
commit 3a0d1c5
Showing
3 changed files
with
66 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters