'Print greek characters in CLion IDE

OS - Windows 8.1

IDE - CLion 2021.3.2

I need to print some greek characters but what I have is these symbols: ╬╗ , ╬╝ , ¤ü

enter image description here

What am I doing wrong? This is my settings for file encodings:

enter image description here

enter image description here



Solution 1:[1]

I resolved installing an old version of Clion (v 2021.1.3) default settings.

enter image description here

Others tentatives changing that not worked:

  1. I had tried to reset the default settings in Clion v 2021.3.2
  2. SetConsoleOutputCP(CP_UTF8); but I needed to change c standard from C99-->C90 in CMakeLists.txt to work

Regarding 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.

Solution 2:[2]

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;
}

Solution 3:[3]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Leonardo
Solution 2 Ilai K
Solution 3 PavlosKoss