3 ms·
I wrote some Unicode generators for RapidCheck that worked perfectly well with GCC and Clang on Unix, but not at all with Visual C++ on Windows. The idea was t
by SloopJon 5y ago
I wrote some Unicode generators for RapidCheck that worked perfectly well with GCC and Clang on Unix, but not at all with Visual C++ on Windows. The idea was to generate arbitrary code points within various ranges (ASCII, Latin-1, BMP, etc. for shrinking) as UTF-32 / UCS-4 in a u32string, then convert to the datatype and encoding for the API under test--UTF-8 in a string, UTF-16 in a u16string, UTF-something in a wstring, etc. The problem was, some of the conversion facets just aren't supported in the Visual C++ runtime library. I think I ended up doing the UTF-32 to UTF-16 conversion myself.
The other thing I ran into recently, is that u"" string literals that worked on GCC / Linux, Clang / Mac, and VC++ 2017 / Windows 2012 did not work for a colleague on VC++ 2019 / Windows 10. An emoji, for example, came out as four char16_t code units (one for each byte of the UTF-8 encoding, I think), instead of two. We ended up using Unicode escapes instead, although the source code is less colorful without a pile of poo.
This ztd.text library looks interesting, although it's a little discouraging that the getting started section of the documentation is empty. Is this a header-only library?