Reads a UTF-8 character specified by an array of byte characters and constructs a u8_ch_data object with information about it.
- Template Parameters
-
throw_on_failure | A boolean flag which specifies whether the function should throw an exception when the multi-byte value in the array pSymbol specifies an invalid or incomplete UTF-8 character. If the flag is false , the function is marked noexcept and returns a default-constructed u8_ch_data object in case of an invalid/incomplete UTF-8 character. The default value is true . |
N | is a deducible size of the array pSymbol . |
- Parameters
-
pSymbol | is an array of char elements to contain the UTF-8 code to read. Its size is not required be equal to the actual byte size of the UTF-8 code to obtain, but may be greater. |
- Returns
- An object of type u8_ch_data. On success it describes a Unicode 11.0 code point of the multi-byte character having been read and its byte length. On failure, the function either throws an exception or returns a default-constructed u8_ch_data depending on the value of
throw_on_failure
.
The function is constexpr
when compiled by a C++14 compiler.
- Exceptions
-
- See also
- Chusov::String::read_u8_char_data(InputIterator itSymbol, std::size_t cbSymbol = UTF8_MAX_LEN) "read_u8_char_data".