[SG16-Unicode] Convert between std::u8string and std::string

Lyberta lyberta at lyberta.net
Fri May 3 13:12:00 CEST 2019


So GCC 9 has been released and I'm starting migration to char8_t. The
first question is how to print std::u8string? Since std::cout works in
execution character set I need a way to convert string from UTF-8 to ECS.

It looks like the only way is to use std::c8rtomb but the API is very
cryptic and I don't understand it. Can someone provide an example code?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
Url : http://www.open-std.org/pipermail/unicode/attachments/20190503/0b59db2a/attachment.bin 


More information about the Unicode mailing list