Sappiamo che nella stringa letterale "\ u94b1" sarà convertito in un carattere, in questo caso una parola cinese '钱'. Ma se è letteralmente 6 caratteri in una stringa, dicendo '\', 'u', '9', '4', 'b', '1', come posso convertirlo manualmente in un personaggio?Come posso convertire una stringa come " u94b1" in un vero carattere in C++?
Ad esempio:
string s1;
string s2 = "\u94b1";
cin >> s1; //here I input \u94b1
cout << s1 << endl; //here output \u94b1
cout << s2 << endl; //and here output 钱
voglio convertire s1
in modo che cout << s1 << endl;
sarà anche uscita 钱
.
Qualche suggerimento, per favore?
Possibile duplicato di http://stackoverflow.com/questions/3147900/how-to-read-file-which-contains-uxxxx-in-vc – kennytm