Home > Back-end >  C - Print greek characters in CLion IDE
C - Print greek characters in CLion IDE

Time:01-29

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

CodePudding user response:

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

CodePudding user response:

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.

  •  Tags:  
  • Related