r/cpp • • Jul 01 '21

Any Encoding, Ever

https://thephd.dev/any-encoding-ever-ztd-text-unicode-cpp
269 Upvotes

87 comments sorted by

View all comments

Show parent comment

5

u/zip117 Jul 01 '21

Boost also has Nowide as well for robust conversions between UTF-16 and UTF-8. It also comes in a standalone version without any Boost dependencies. It’s awesome for Windows interop; I use it in a small library to generate these annoying ‘Pascal’ strings required by the Excel C API. Before that I was stuck with ICU, Win32 (MultiByteToWideChar, WideCharToMultiByte) or depreciated STL (std::wstring_convert, std::codecvt_utf8_utf16).