2021-04-03から1日間の記事一覧
VC++ではワイド文字列(L"...")に絵文字を含めることができます。この文字列に対してstd::iswgraphを適用しても戻り値はfalseです。 #include <string> #include <cwctype> #include <iostream> #include <iomanip> int main() { const std::wstring s{ L"" }; for (auto i = s.cbegin(); i != s</iomanip></iostream></cwctype></string>…
UTF-16サロゲートペア判定とUTF-16/UTF-32文字列の相互変換コードです。Unicodeの仕様はネット上の解説ページを参照しているため、間違えてる可能性もあります。 #include <algorithm> #include <string> namespace u16_surrogatepair { const char16_t high_surrogate_first =</string></algorithm>…