Produces a C++ string of Unicode 11.0 code points from bytes of a UTF-8 encoded zero-terminated string.
- Template Parameters
-
CharTraits | specifies a CharTraits type used to instantiate the std::basic_string class in order to produce the output string. By default it is an instantiation of std::char_traits for the type ucp_t. Such specialization is provided by the chsvlib library to treat ucp_t based strings as case-sensitive and 0-terminated. |
Allocator | is a type of an Allocator used to instantiate the returned string object. By default it resolves to. |
CPtr | is a (referenced) type of a possibly cv-qualified pointer to a C-string of char characters. This overload of u8_encode_string does not participate in overload resolution unless CPtr is a (possibly referenced and/or cv_qualified) pointer to char . |
- Parameters
-
pszUtf8 | is a zero-terminated UTF-8 C string to convert to the returned ucp_t based C++ string. |
- Returns
- A newly created string, an instantiation of std::basic_string, with Unicode 11.0 code points as its elements along with optionally specified CharTraits and Allocator.
- Exceptions
-
- Note
- The
CPtr
template parameter is introduced to disambiguate calls to this overload as opposed to the overload which accepts references to arrays of char
.
- See also
- ucp_string