I am developing a C++ application in CLion using MSYS2's MinGW64 compiler. My project involves outputting Chinese characters, but despite setting everything to UTF-8 (Global/File/Terminal encodings in CLion, source file encoding, and PowerShell terminal encoding), the characters are not displayed correctly. They appear as garbled text or question marks in the output.
Ensured all encodings in CLion (Global, File, Terminal) are set to UTF-8.Verified the source file is saved in UTF-8 encoding.Changed PowerShell's encoding to UTF-8 using chcp 65001.Set LANG and LC_ALL environment variables to en_US.UTF-8 in Windows.Experimented with handling and printing strings using std::wstring and std::wcout in C++.I expected these steps to allow Chinese characters to be displayed correctly in the output, but they are still appearing incorrectly. It seems like there's a missing piece in the configuration or a compatibility issue with the tools and environment I'm using.