Quantcast
Channel: Active questions tagged utf-8 - Stack Overflow
Viewing all articles
Browse latest Browse all 1052

Chinese character turns into �� or @@ or just nothing [closed]

$
0
0

For example:

image

In run and debug:

image

In terminal:

image

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:

image

The expression is str1="\255\346��", but the output shows normally.

In run and debug:

image

In terminal:

image

What I have tried:

  1. select encoding and reopen with GBK
  2. open settings-Text Editor-Files-Encoding and select UTF-8
  3. turn on Auto Guess Encoding
  4. using wstring and wcin and wcout
  5. type chcp 65001 in the terminal
  6. edit my launch.json and change the environment's "[]", making it use UTF-8
  7. 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.


Viewing all articles
Browse latest Browse all 1052

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>