Reputation: 119
OS - Windows 8.1
IDE - CLion 2021.3.2
I need to print some greek characters but what I have is these symbols: ╬╗ , ╬╝ , ¤ü
What am I doing wrong? This is my settings for file encodings:
Upvotes: -1
Views: 743
Reputation: 11
control panel -> region ->adminstrative -> change system locale and use Beta UTF 8,restart
I know it is an old thread however I found a simple solution for greek characters https://prnt.sc/UWMo7rcnbj65
Upvotes: 1
Reputation: 1
While you work on CLion open the file in notepad++ then menu Encoding - Encoding in ANSI, and save. In your open CLion you will see that the file was loaded in a wrong encoding:'UTF-8'. Click on reload in 'windows-1253' and you 'll be OK.CLion reload in windows 1253
Upvotes: 0
Reputation: 119
I resolved installing an old version of Clion (v 2021.1.3) default settings.
Others tentatives changing that not worked:
SetConsoleOutputCP(CP_UTF8);
but I needed to change c standard from C99-->C90 in CMakeLists.txt to workRegarding the negative score, maybe it was a banal question, but I tried to solve it from a week unsuccessfully. I am not an expert in the language C or in computer science in general, and I just did not have others to ask how to solve my problem, thus I have only wanted some help.
Upvotes: 0
Reputation: 126
Set your console font to a Unicode TrueType font and emit the data using an "ANSI" mechanism. For example this code prints γειά σου:
#include "windows.h"
int main()
{
SetConsoleOutputCP(1253); //"ANSI" Greek
printf("\xE3\xE5\xE9\xDC \xF3\xEF\xF5"); // encoded as windows-1253
return 0;
}
Upvotes: 0