Hacker News new | ask | show | jobs
by ack_complete 73 days ago
The Windows API uses WCHAR = wchar_t, so if you use char16_t, you have to convert back and forth to avoid running afoul of strict aliasing rules. This imposes conversion costs without benefits; both using wchar_t directly or converting to/from UTF-8 are better.
1 comments

Or, set up the manifest in your app[1], and just use UTF-8 and `std::string`/`std::string_view` everywhere.

[1]: https://learn.microsoft.com/en-gb/windows/apps/design/global...