diff options
author | crupest <crupest@outlook.com> | 2020-04-05 21:44:07 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-04-05 21:44:07 +0800 |
commit | abcaa16c897678fa3fa4cda3f23660e4ca46b841 (patch) | |
tree | 1ce5fb102548d28a33838f2c30d5ed4e6571abbf /include/cru/win/string.hpp | |
parent | 37bb421e963662e8203acbe3a03bdbd5d1f5858e (diff) | |
download | cru-abcaa16c897678fa3fa4cda3f23660e4ca46b841.tar.gz cru-abcaa16c897678fa3fa4cda3f23660e4ca46b841.tar.bz2 cru-abcaa16c897678fa3fa4cda3f23660e4ca46b841.zip |
...
Diffstat (limited to 'include/cru/win/string.hpp')
-rw-r--r-- | include/cru/win/string.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/cru/win/string.hpp b/include/cru/win/string.hpp index 3fdadbf8..b2bfd245 100644 --- a/include/cru/win/string.hpp +++ b/include/cru/win/string.hpp @@ -27,6 +27,14 @@ namespace cru::platform::win { std::string ToUtf8String(const std::wstring_view& string); std::wstring ToUtf16String(const std::string_view& string); +inline bool IsSurrogatePairLeading(wchar_t c) { + return c >= 0xD800 && c <= 0xDBFF; +} + +inline bool IsSurrogatePairTrailing(wchar_t c) { + return c >= 0xDC00 && c <= 0xDFFF; +} + using CodePoint = std::int32_t; constexpr CodePoint k_code_point_end = -1; |