diff --git a/readme.md b/readme.md index e30abf6..a1a01a5 100644 --- a/readme.md +++ b/readme.md @@ -50,7 +50,7 @@ No support for 8-bit encodings and related *codepages*, it's time to drop them. - Return value - `std::u32string` - Description - - Converts bytes a *utf-32* string + - Converts bytes to a *utf-32* string [example](https://gcc.godbolt.org/z/co81s7PYx) @@ -91,8 +91,8 @@ std::cout << utxt::to_utf8(U"..."sv) - Return value - `std::string` encoded bytes as `OUTENC` - Description - - Encodes a `char32_t` string or codepoint - The run time version contains a `switch` that instantiates the correct template + - Encodes a `char32_t` string or codepoint. + *The run time version contains a `switch` that instantiates the correct template* [example](https://gcc.godbolt.org/z/5eMWxar1Y) @@ -115,8 +115,8 @@ std::string out_bytes2 = utxt::encode_as(UTF16BE, U"..."sv); - Return value - `std::string` output bytes encoded as `OUTENC` - Description - - Re-encodes a string of bytes (detecting its encoding) to a given encoding - The run time version contains a `switch` that instantiates the correct template + - Re-encodes a string of bytes (detecting its encoding) to a given encoding. + *The run time version contains a `switch` that instantiates the correct template* [example](https://gcc.godbolt.org/z/jf3Wh9jrK) @@ -177,7 +177,7 @@ std::string_view out_bytes = utxt::reencode_if_necessary(in_bytes, --- -## Low level functions +## Low level facilities --- ### `bytes_buffer_t` class @@ -265,6 +265,7 @@ assert( cp == U'🔥' ); ```cpp std::string bytes = "a "; -char32_t codepoint = U'🍌'; +char32_t codepoint = U'🔥'; utxt::append_codepoint(codepoint, bytes); +assert( bytes == "a \xF0\x9F\x94\xA5"sv); ```