How to use VSCode to watch a Chinese string in C++?

Viewed 244

I want to debug a C++ program in VS code. However, when I watch a variable which is a Chinese string, it displays a series of Unicode characters. How can I get the correct Chinese value of this variable? enter image description here

1 Answers

The problem is caused by the system charset in docker. The default charset en_US.UTF-8 doesn't support Chinese. When I set the charset to C.utf8, now the VS Code can display Chinese string correctly.

LANG=C.utf-8
source /etc/profile

enter image description here

Related