当前位置:网站首页>Clion console output Chinese garbled code

Clion console output Chinese garbled code

2022-07-04 08:49:00 Hu Anmin

For programmers engaged in software development ,JetBrains The whole family bucket is convenient to use . Whether it's Android Development uses AndroidStudio, Or is it Web Developed WebStorm , Until then C Linguistic CLion. The same interface style , Familiar shortcut keys , Everything is so smooth to use .

In order to learn C Language and data structure , I chose CLion As IDE. One day when I output Chinese on the console , The output is garbled . The solution is hereby recorded .

Set encoding

  • open File —> Settings —> Editor
  • choice File Encodings
  • Set encoding to UTF-8

 Insert picture description here
After setting up , Run the project and find that it is still garbled . The reason is that you need to change the code of the console to GBK.
 Insert picture description here
Only this and nothing more , Be accomplished . But the above is based on Windows system , Let's talk about Xiayu Windows Run in Ubuntu Code written in , The resulting garbled code problem .

 Insert picture description here
 Insert picture description here

give the thumbs-up - Collection - Focus on - Easy to review and receive the latest content in the future
There are other questions to discuss in the comments section - Or believe me - I will reply as soon as I receive it
thank , coordination , I hope my efforts will help you ^_^

disclaimer : Part of the material in this paper comes from the Internet , The copyright belongs to the creator , If articles exist / picture / Improper use of audio and video , Please feel free to contact me by private letter .
原网站

版权声明
本文为[Hu Anmin]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/185/202207040846252608.html