-1

I want to create a console application for phasor* addition in C.

I want C to display the symbol. I don't know how to make C to display UNICODE. I simply tried printf("∠"); but it printed a question mark in a box. I'm using MinGW.

Thanks in advance.

*phasor is an AC electric topic.

  • Does this answer your question? [Printing a Unicode Symbol in C](https://stackoverflow.com/questions/43834315/printing-a-unicode-symbol-in-c) – r3mainer Mar 28 '21 at 11:46
  • That � question mark in a box could be [glyph 0](https://learn.microsoft.com/en-us/typography/opentype/spec/recom#glyph-0-the-notdef-glyph). The ∠ symbol (angle) is e.g. in the `DejaVu Sans Mono` or `Unifont` font… – JosefZ Mar 28 '21 at 13:45

1 Answers1

0

to print the phasor symbol use "\u2220" if you are using c99

#include<stdio.h>
int main()
{
    puts("\u2220");
}

as r3mainer pointed out Printing a Unicode Symbol in C below code works with c89

#include <stdio.h>
#include <wchar.h>
#include <locale.h>
int main() {
    setlocale(LC_CTYPE, "");
    wchar_t phasor = 0x2220;
    wprintf(L"%lc\n", phasor);
}

check this for encoding is it UTF-16 or UTF-32

MONUDDIN TAMBOLI
  • 152
  • 1
  • 11