0

I'm trying to print ≠ for a University Project

I'm using CodeBlocks with encoding UTF-8

I searched methods and i found one using UNICODE in C and i tried to replicate in a blank code to test and didn't print

#include <stdio.h>
#include <locale.h>
#include <wchar.h>

int main(){
  setlocale(LC_ALL,"");
  printf("\%lc\n",(wchar_t)0x2260);
}

i tried other things but it doesn't print anything or printed random characters like "â%", can someone help or give an idea to print the character?

Does it have a relation to my language? Because when i tried to print a Portuguese frase with setlocale(LC_ALL,""); also printed random characters.

EDIT: I'm using Windows 10, in cmd is going normally but in CodeBlocks Terminal doesn't.

  • Does this answer your question? [Printing a Unicode Symbol in C](https://stackoverflow.com/questions/43834315/printing-a-unicode-symbol-in-c) – kotatsuyaki Nov 21 '22 at 14:56
  • Also, without looking into it too much, you may be doing it correct, but your environment may be wrong. What console/terminal/environment do you have going on? – Jason Nov 21 '22 at 14:57
  • 1
    windows 10, it really annoys me that in cmd it works so i think its the codeblocks terminal is broken – Thiaguinhu123 Nov 21 '22 at 15:30

0 Answers0