Latin Capital Letter 'E' with Circumflex (Ê)

Solution 1:

Windows is a pain when it comes to printing Unicode text, but the following should work with all modern compilers (MSVC 19 or later, g++ 9 or greater) on all modern Windows systems (Windows 10 or greater), in both Windows Console and Windows Terminal:

   #include <iostream>
   #include <windows.h>
   
   int main()
   {
     SetConsoleOutputCP( CP_UTF8 );
     std::cout << "TYCHÊ" << "\n";
   }

Make sure your compiler takes UTF-8 as the input character set. For MSVC 19 you need a flag. I think it is the default for later versions, but I am unsure on that point:

cl /EHsc /W4 /Ox /std:c++17 /utf-8 example.cpp
g++ -Wall -Wextra -pedantic-errors -O3 -std=c++17 example.cpp

EDIT: Dangit, I misread the language tag again. :-(
Here’s some C:

#include <stdio.h>
#include <windows.h>

int main()
{
  SetConsoleOutputCP( CP_UTF8 );
  printf( "%s\n", "TYCHÊ" );
  return 0;
}