Shared/Utf8.h file

Namespace Death::Utf8.

Namespaces

namespace Death
Shared root namespace.
namespace Death::Utf8
Unicode (UTF-8. UTF-16 and UTF-32) utilities.

Functions

auto GetLength(Containers::ArrayView<const char> text) -> std::size_t
Number of characters in a UTF-8 string.
auto NextChar(Containers::ArrayView<const char> text, std::size_t cursor) -> std::pair<char32_t, std::size_t>
Next UTF-8 character.
template<std::size_t size>
auto NextChar(const char(&text)[size], const std::size_t cursor) -> std::pair<char32_t, std::size_t>
auto PrevChar(Containers::ArrayView<const char> text, std::size_t cursor) -> std::pair<char32_t, std::size_t>
Previous UTF-8 character.
template<std::size_t size>
auto PrevChar(const char(&text)[size], const std::size_t cursor) -> std::pair<char32_t, std::size_t>
auto FromCodePoint(char32_t character, Containers::StaticArrayView<4, char> result) -> std::size_t
Converts a UTF-32 character to UTF-8.
auto ToUtf16(const char* source, std::int32_t sourceSize) -> Containers::Array<wchar_t>
Widens a UTF-8 string to UTF-16 for use with Windows Unicode APIs.
auto ToUtf16(Containers::StringView source) -> Containers::Array<wchar_t>
auto ToUtf16(const char* source) -> Containers::Array<wchar_t>
auto ToUtf16(wchar_t* destination, std::int32_t destinationSize, const char* source, std::int32_t sourceSize = -1) -> std::int32_t
template<std::int32_t size>
auto ToUtf16(wchar_t(&destination)[size], const char* source, std::int32_t sourceSize = -1) -> std::int32_t
auto FromUtf16(const wchar_t* source, std::int32_t sourceSize) -> Containers::String
Narrows a UTF-16 string to UTF-8 for use with Windows Unicode APIs.
auto FromUtf16(Containers::ArrayView<const wchar_t> source) -> Containers::String
auto FromUtf16(const wchar_t* source) -> Containers::String
auto FromUtf16(char* destination, std::int32_t destinationSize, const wchar_t* source, std::int32_t sourceSize = -1) -> std::int32_t
template<std::int32_t size>
auto FromUtf16(char(&destination)[size], const wchar_t* source, std::int32_t sourceSize = -1) -> std::int32_t