MSTL 1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
Unicode代理对处理

UTF-16代理对相关函数 更多...

函数

MSTL_CONST_FUNCTION constexpr bool is_high_surrogate (const char16_t c) noexcept
 检查字符是否为高代理项
MSTL_CONST_FUNCTION constexpr bool is_low_surrogate (const char16_t c) noexcept
 检查字符是否为低代理项
MSTL_CONST_FUNCTION constexpr uint32_t combine_surrogates (const char16_t high, const char16_t low) noexcept
 组合高代理项和低代理项为完整的Unicode码点

详细描述

UTF-16代理对相关函数

函数说明

◆ combine_surrogates()

MSTL_CONST_FUNCTION constexpr uint32_t combine_surrogates ( const char16_t high,
const char16_t low )
constexprnoexcept

组合高代理项和低代理项为完整的Unicode码点

参数
high高代理项
low低代理项
返回
组合后的Unicode码点

根据UTF-16编码规则将两个代理项组合为完整的码点。

在文件 char_types.hpp330 行定义.

◆ is_high_surrogate()

MSTL_CONST_FUNCTION constexpr bool is_high_surrogate ( const char16_t c)
constexprnoexcept

检查字符是否为高代理项

参数
cUTF-16字符
返回
如果字符是高代理项则返回true,否则返回false

高代理项的范围是0xD800-0xDBFF。

在文件 char_types.hpp307 行定义.

◆ is_low_surrogate()

MSTL_CONST_FUNCTION constexpr bool is_low_surrogate ( const char16_t c)
constexprnoexcept

检查字符是否为低代理项

参数
cUTF-16字符
返回
如果字符是低代理项则返回true,否则返回false

低代理项的范围是0xDC00-0xDFFF。

在文件 char_types.hpp318 行定义.