Home > Back-end >  [for] cin get Chinese string from the console is not successful.
[for] cin get Chinese string from the console is not successful.

Time:12-10

Vs2019 win10 system, inside the system Settings has been checked "provide global language use utf-8 support"
In using the console program, through the cin get string variable, cout is used after the input string in Chinese output is garbled, sometimes letters, sometimes is a symbol, just can't show Chinese.
How do I solve.

CodePudding user response:

You don't post code, who knows? My is vs2019 win10 system, picture is truth,

CodePudding user response:

Cin + out code is the most simple, direct in vs2019 use F5 debugging, the console is powershell.
#include
#include
using namespace std;

Int main () {
string name;
Cin & gt;> The name;
Cout & lt; <" The output "& lt; }


  • Related