god::encoding#

Note

Declared in <god/encoding.hpp>

namespace encoding#

Functions

std::size_t countchars(std::string_view str) noexcept#

Get the number of logical characters in a UTF-8 string.

Parameters:

str – The string to count

Returns:

The number of characters as a size_t

std::size_t countchars(const char *str) noexcept#

Get the number of logical characters in a UTF-8 string.

Parameters:

str – The string to count

Returns:

The number of characters as a size_t

std::pair<bool, std::size_t> validate(const std::deque<std::string> &strs) noexcept#

Check strings for UTF-8 validity.

Parameters:

strs – A deque of strings to validate

Returns:

A pair of a boolean indicating validation success and a size_t denoting the index of an encountered failure

std::pair<bool, std::size_t> validate(const std::vector<std::string> &strs) noexcept#

Check strings for UTF-8 validity.

Parameters:

strs – A vector of strings to validate

Returns:

A pair of a boolean indicating validation success and a size_t denoting the index of an encountered failure