int main() {
std::cout << "\u2654" << std::endl; // Result #1: ?
std::cout << U'\u2654' << std::endl; // Result #2: 9812
std::cout << U'?' << std::endl; // Result #3: 9812
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我无法理解Unicode如何与C++一起工作.为什么文字输出终端中的文字?
我有点想要这样的事情;
char32_t txt_representation() { return /* Unicode codepoint */; }
Run Code Online (Sandbox Code Playgroud)
注意:源是UTF-8,终端,坐在macOS Sierra,CLion上.