Can command prompt display unicode characters?

后端 未结 5 602
不知归路
不知归路 2021-01-20 01:49

For example:

cout << \"你好\" << endl;
5条回答
  •  野的像风
    2021-01-20 02:38

    Depends on the operating system and implementation. The currently active C++ standard doesn't even talk about Unicode.

    On Windows I believe you can use the wide character versions. Your code would then need to be:

    std::wcout << L"ni3 hao3" << std::endl;
    

    However, you might have to specifically enter the Unicode character codes because the codeset you're using to write your C++ source might not be Unicode.

提交回复
热议问题