diff options
author | Norbert Preining <norbert@preining.info> | 2023-06-08 03:01:59 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-06-08 03:01:59 +0000 |
commit | 538e6d6e7c75b7cca5470604811205f9dbd55c03 (patch) | |
tree | 4807afb694acc9e4ecff2d466d5e37788127d6fb /graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/unchecked.h | |
parent | 5c99135c06494b236cce7fd76e346851cf8c4408 (diff) |
CTAN sync 202306080301
Diffstat (limited to 'graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/unchecked.h')
-rw-r--r-- | graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/unchecked.h | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/unchecked.h b/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/unchecked.h index 8bc34e8f65..7151a35b67 100644 --- a/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/unchecked.h +++ b/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/unchecked.h @@ -37,24 +37,7 @@ namespace utf8 template <typename octet_iterator> octet_iterator append(uint32_t cp, octet_iterator result) { - if (cp < 0x80) // one octet - *(result++) = static_cast<uint8_t>(cp); - else if (cp < 0x800) { // two octets - *(result++) = static_cast<uint8_t>((cp >> 6) | 0xc0); - *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80); - } - else if (cp < 0x10000) { // three octets - *(result++) = static_cast<uint8_t>((cp >> 12) | 0xe0); - *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80); - *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80); - } - else { // four octets - *(result++) = static_cast<uint8_t>((cp >> 18) | 0xf0); - *(result++) = static_cast<uint8_t>(((cp >> 12) & 0x3f)| 0x80); - *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80); - *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80); - } - return result; + return internal::append(cp, result); } template <typename octet_iterator, typename output_iterator> |