3 ms·
UTF-16 is only a pain when working with Windows APIs though. Most other 'legacy APIs' I've seen so far provide easy ways to get UTF-8 encoded data in and out, e
by flohofwoe 4y ago
UTF-16 is only a pain when working with Windows APIs though. Most other 'legacy APIs' I've seen so far provide easy ways to get UTF-8 encoded data in and out, even though they use UTF-16 under the hood (like [NSString stringWithUTF8String:] on macOS).
- int_19h 4y agoWin32 also has MultiByteToWideChar and friends, although being a C API, it's not particularly pleasant to use. For newer HSTRING-based WinRT APIs, if you're calling them from C++, you're probably going to use C++/WinRT, which provides conversion functions that operate on std::string_view and std::wstring_view. So, you're right, I need to amend that to "mostly needed for file formats and protocols".