Reminder: display of Chinese characters

我发现很多人遇到了和我一样的问题,在vs仿真时无法正常显示汉字。我使用的是vs2019。仿真时汉字一直无法显示,直接在数组填充unicode编码是可以显示的,应该是编译器的问题。今天偶然发现,换eclipse仿真就可以了,同样的代码。希望对各位有用。

I find that many people encounter the same problem as me, and they can’t display Chinese characters normally in vs simulation. I use vs2019. During the simulation, Chinese characters can’t be displayed all the time. It can be displayed by filling the array with Unicode code directly, which should be the problem of compiler. Today, I found out by accident that it’s OK to change the eclipse simulation, the same code. I hope it will be useful to you.

1 Like

Hi,

There should be a setting in VS to change the default encoding. It means how the IDE encodes the strings you enter. It should be UTF-8.

See this: https://docs.microsoft.com/en-us/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8?view=vs-2019

Thanks.
It’s really a coding problem. Instead, utf8 without BOM can be displayed, but only double number Chinese characters can be displayed. Otherwise, vs reports a syntax error. This should be due to vs’s own problems. I see the same hint in an open source project.