Skip to content

Commit

Permalink
Update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
matgat authored Feb 10, 2024
1 parent bdf8012 commit ec94a75
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand All @@ -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)

Expand Down Expand Up @@ -177,7 +177,7 @@ std::string_view out_bytes = utxt::reencode_if_necessary<INENC,OUTENC>(in_bytes,


---
## Low level functions
## Low level facilities

---
### `bytes_buffer_t` class
Expand Down Expand Up @@ -265,6 +265,7 @@ assert( cp == U'🔥' );
```cpp
std::string bytes = "a ";
char32_t codepoint = U'🍌';
char32_t codepoint = U'🔥';
utxt::append_codepoint<UTF8>(codepoint, bytes);
assert( bytes == "a \xF0\x9F\x94\xA5"sv);
```

0 comments on commit ec94a75

Please sign in to comment.