Originally Posted by
christop
I've had to deal briefly with WCHAR and TCHAR strings in Windows. I imagine I'd develop PTSD if I had to do that on a regular basis.
Well... I believe I would have some kind of brain injury if I had to deal with WINOWS in a regular basis... Take a look:
Code:
// test.c
#include <windows.h>
int main( void )
{
HANDLE hc;
static const WCHAR msg1[] = L"\u20ac\n"; // EURO (U+20AC) -- ok!
static const WCHAR msg2[] = L"\U0001d11e\n"; // SOL CLEEF (U+1D11E) -- doesn't work!
hc = GetStdHandle( STD_OUTPUT_HANDLE );
WriteConsoleW( hc, msg1, ( sizeof msg1 - 1 ) / sizeof msg1[0], NULL, 0 );
WriteConsoleW( hc, msg2, ( sizeof msg2 - 1 ) / sizeof msg2[0], NULL, 0 );
}
Compiling with MSVC (to not have any doubt about this):
Seems WINDOWS don't deal very well with surrogates.