forked from google/orbit
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Force UTF-8 as the process code page on Windows
On Windows, add a new "utf8.manifest" application manifest to Orbit, OrbitService and all tests so that we force UTF-8 as the application code page. With this change, the "A" variants of Windows APIs now support UTF-8, which is great because we don't have to change API calls to their "W" variant, saving a UTF-8 to UTF-16 string conversion in user code. This also makes std::filesystem::path accept UTF-8 strings by default (withouth explicit std::filesystem::u8path() call), and the "std::filesystem::path::string()" also now outputs proper UTF-8 strings out of the box, whitout calling "filesystem::path::u8string()". References: - microsoft/STL#909 - https://docs.microsoft.com/en-us/windows/apps/design/globalizing/use-utf8-code-page - https://cmake.org/cmake/help/v3.4/release/3.4.html#other From CMake's doc: "CMake learned to honor *.manifest source files with MSVC tools. Manifest files named as sources of .exe and .dll targets will be merged with linker-generated manifests and embedded in the binary." Tests: Newly added "UnicodeFileExists" in FileTest.cpp works out of the box without modification to our "FileExists" function. This means that "filesystem::path::exists()" can also be called directly with UTF-8 strings.
- Loading branch information
1 parent
71e366f
commit 63675f9
Showing
6 changed files
with
49 additions
and
2 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
🚀 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<application> | ||
<windowsSettings> | ||
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage> | ||
</windowsSettings> | ||
</application> | ||
</assembly> |