|
OpenEnroth d1a3925
|
Functions | |
| std::string | wideToUtf8 (std::wstring_view wstr) |
| std::wstring | utf8ToWide (std::string_view str) |
| std::string | encodedToUtf8 (std::string_view str, TextEncoding encoding) |
| std::string | utf8ToEncoded (std::string_view str, TextEncoding encoding) |
| std::string txt::encodedToUtf8 | ( | std::string_view | str, |
| TextEncoding | encoding | ||
| ) |
Convert a string from the given encoding to UTF-8.
Invalid or incomplete byte sequences are replaced the Unicode replacement character (U+FFFD).
| str | String in the source encoding. |
| encoding | Source encoding. |
| std::string txt::utf8ToEncoded | ( | std::string_view | str, |
| TextEncoding | encoding | ||
| ) |
Convert a UTF-8 string to the given encoding.
Characters that cannot be represented in the target encoding are replaced with ? or with the Unicode replacement character (U+FFFD).
| str | UTF-8 string to convert. |
| encoding | Target encoding. |
| std::wstring txt::utf8ToWide | ( | std::string_view | str | ) |
Convert a UTF-8 string to a wide string.
On Windows, the output is UTF-16. On other platforms, the output is UTF-32. Invalid sequences are replaced with the Unicode replacement character (U+FFFD).
| str | UTF-8 string to convert. |
| std::string txt::wideToUtf8 | ( | std::wstring_view | wstr | ) |
Convert a wide string to UTF-8.
On Windows, the wide string is assumed to be UTF-16. On other platforms, it's assumed to be UTF-32. Invalid sequences are replaced with the Unicode replacement character (U+FFFD).
| wstr | Wide string to convert. |