Print char32_t to console
问题 How can I print ( cout / wcout / ...) char32_t to console in C++11? The following code prints hex values: u32string s2 = U"Добрый день"; for(auto x:s2){ wcout<<(char32_t)x<<endl; } 回答1: First, I don't think wcout is supposed to print as characters anything but char and wchar_t . char32_t is neither. Here's a sample program that prints individual wchar_t's : #include <iostream> using namespace std; int main() { wcout << (wchar_t)0x41 << endl; return 0; } Output (ideone): A Currently, it's