相关疑难解决方法(0)

Unicode文字 - 这甚至有意义吗?

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上.

c++ unicode character-encoding

1
推荐指数
1
解决办法
239
查看次数

标签 统计

c++ ×1

character-encoding ×1

unicode ×1