convertUtf8StringToUtf32#
Fully qualified name: carb::extras::convertUtf8StringToUtf32
Defined in carb/extras/Utf8Parser.h
- inline size_t carb::extras::convertUtf8StringToUtf32(
- cpp::string_view str,
- char32_t *out,
- size_t outLen,
Convert a UTF-8 encoded string to UTF-32.
- Parameters:
str – [in] The input UTF-8 string to convert.
out – [out] The output buffer to hold the UTF-32 data. This must be at least
outLenin length, in elements. This can benullptrto calculate the required output buffer length. The output string written tooutwill always be null terminated (unlessoutLenis 0), even if the string had to be truncated.outLen – [in] The length of
out, in elements. This should be 0 ifoutisnullptr.
- Returns:
If
outis notnullptr, this returns the number of UTF-32 characters written toout. This includes the null terminating character.- Returns:
If
outisnullptr, this returns the required buffer length to store the output string.