MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / utf32_to_utf16

Function utf32_to_utf16

modules/core/core/include/OpenString/unicode.h:178–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176 }
177
178 [[nodiscard]] constexpr std::array<char16_t, utf16::SEQUENCE_MAXIMUM_LENGTH> utf32_to_utf16(char32_t const utf32) noexcept
179 {
180 return utf32 <= utf16::SINGLE_UNIT_MAXIMUM_VALUE ?
181 std::array<char16_t, utf16::SEQUENCE_MAXIMUM_LENGTH>{ static_cast<char16_t>(utf32) } :
182 std::array<char16_t, utf16::SEQUENCE_MAXIMUM_LENGTH>{
183 static_cast<char16_t>((utf32 >> 10) + utf16::LEADING_SURROGATE_HEADER),
184 static_cast<char16_t>((utf32 & utf16::SURROGATE_MASK) + utf16::TRAILING_SURROGATE_HEADER) };
185 }
186
187 [[nodiscard]] constexpr std::array<char16_t, utf16::SEQUENCE_MAXIMUM_LENGTH> utf8_to_utf16(ochar8_t const* const utf8, const u64 length) noexcept
188 {

Callers 2

wide_text.cppFile · 0.85
utf8_to_utf16Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected