Converts a given container with a sequence of Unicode code points to the corresponding UTF-8 representation and returns the latter as a C++ string object. .
- Template Parameters
-
CharTraitsTo | is a CharTraits object used to instantiate the std::basic_string template and create the output string. By default it resolves to. |
AllocatorTo | is an Allocator object to instantiate the std::basic_string to produce the type of the resulting string. By default it resolves to. |
Container | is a deducible type of a C++ Container of the ucp_t based string of Unicode code points to convert to the UTF-8 representation. |
- Parameters
-
str | is an input C++ Container of characters of the type ucp_t specifying the input string of Unicode code points. |
- Returns
- A newly created multi-byte
char
based C++ string object holding the UTF-8 representation of str
.
- Note
- This overload does not participate in the overload resolution if
Container
is an std::basic_string or (C++17) [std::basic_string_view] object with the traits_type
subtype be a template of one type argument.
- Exceptions
-
- See also
- u8_encode_string An overload chosen if the
str
is an std::basic_string or (C++17) [std::basic_string_view] object with the traits_type
subtype be a template of one type argument.