Output UTF-8 (u8) std::string
问题 In C++11 and later, using the u8 prefix on a string literal can create char (byte) sequences that are UTF-8 encoded. How do you output those sequences to a std::ostream ? How do you tell a std::ostream that a const char * or std:string to be output contains characters encoded in UTF-8, rather than the default encoding? 回答1: You don't. The stream does not know or care what the encoding of the text is. Despite it's name, a char is not treated by std:ostream as containing a character encoded in