For example:
In run and debug:
In terminal:
When I input any Chinese, the debugging interface will show that the value of str1
is ��
or @@
or just nothing, and it's a little unstable (but �
is quite common).
However, in this situation:
The expression is str1="\255\346��"
, but the output shows normally.
In run and debug:
In terminal:
What I have tried:
- select encoding and reopen with
GBK
- open settings-Text Editor-Files-Encoding and select
UTF-8
- turn on Auto Guess Encoding
- using
wstring
andwcin
andwcout
- type
chcp 65001
in the terminal - edit my
launch.json
and change the environment's "[]", making it use UTF-8 - In Windows's language settings, turn on Beta version: Provide global language support using Unicode
UTF-8
I hope that I can maintain consistency between the value and the output, and I can cin
and cout
Chinese characters normally, without using wstring
.