How to solve the problem of garbled Chinese and English characters output from the terminal #1715
-
The output from my terminal shows garbled text when printing both Chinese and English characters. I’ve tried various methods I found online (though the cases weren’t exactly the same as mine), but none of them worked. Below are some characteristics and test results I observed, and I hope someone can tell me how to solve this problem: (C++)
Based on the above characteristics, I believe the issue lies with scanf and printf. Here are the methods/settings I've tried so far:
================================================= 我的終端機輸出中文與英文時會變成亂碼,我試圖在網路上查詢各種方法(和我遇到的情況不太一樣),但是都沒有用。以下是我觀察到的一些特徵與測試結果,希望有人能告訴我該如何解決:
目前我嘗試過的方法/設定:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @alex8788 - this discussion forum is primarily for extension development (see #5) and there might be a better public forum (like StackOverflow) to ask this question. That said - I also know that font choice is important for the terminal. I'm also wondering if there is a pointer issue here (I'm not a C++ person but when something weird happens with variables that's the first thing I think). Either way: it seems to be more of a C++ issue than a VS Code one. |
Beta Was this translation helpful? Give feedback.
-
Do you try these two options for g++ option? |
Beta Was this translation helpful? Give feedback.
Hi @alex8788 - this discussion forum is primarily for extension development (see #5) and there might be a better public forum (like StackOverflow) to ask this question. That said - I also know that font choice is important for the terminal. I'm also wondering if there is a pointer issue here (I'm not a C++ person but when something weird happens with variables that's the first thing I think). Either way: it seems to be more of a C++ issue than a VS Code one.