use the Unicode version of the WriteConsole function.
also, be sure to store the source code as UTF-8 with BOM, which is supported by both g++ and visual c++
Example, assuming that you want to present a greek alpha given its Unicode code in the form "u+03B1" (the code you listed stands for a lowercase "t"):
#include <stdlib.h> // exit, EXIT_FAILURE, wcstol #include <string> // std::wstring using namespace std; #undef UNICODE #define UNICODE #include <windows.h> bool error( char const s[] ) { ::FatalAppExitA( 0, s ); exit( EXIT_FAILURE ); } namespace stream_handle { HANDLE const output = ::GetStdHandle( STD_OUTPUT_HANDLE ); } // namespace stream_handle void write( wchar_t const* const s, int const n ) { DWORD n_chars_written; ::WriteConsole( stream_handle::output, s, n, &n_chars_written, nullptr // overlapped i/o structure ) || error( "WriteConsole failed" ); } int main() { wchar_t const input[] = L"u+03B1"; wchar_t const ch = wcstol( input + 2, nullptr, 16 ); wstring const s = wstring() + ch + L"\r\n"; write( s.c_str(), s.length() ); }
wprintforstd::wcout?t. alpha would be u+03B1 in Unicode.