Leonardo
Leonardo

Reputation: 119

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

Upvotes: -1

Views: 743

Answers (4)

Michail Choursoulidis
Michail Choursoulidis

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

PavlosKoss
PavlosKoss

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

Leonardo
Leonardo

Reputation: 119

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.

Upvotes: 0

Ilai K
Ilai K

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

Related Questions