when I code exactly like this:
setlocale(LC_ALL,"");
wchar_t myString2[] = { 0x0061, 0x2660, 0x2663, 0x2665, 0x2666, 0x0000 };
fd = _wfopen(myString2, L"w");
or
fd = _wfopen(myString2, L"w, ccs=UTF-16");
The result is not what I expect. Expected: a♠♣♥♦, but explorer shows up a and then 4 small squares. However, When I enter file rename in explorer, and then copy the filename, it is inserted correctly into an editor. When I put a filename which shows up such characters, or let's say chinese characters are copied & pasted in an editor, the editor shows up the small squares into the file name. Experiments with -fexec-charset=xxxx even don't yield the desired result. Given the results of the copy & paste experiments, I guess that something very stupid is going on. It this is true, the solution should be stupidly simple...
System: Win XP, Mingw 20120426, Ansi-C - so STLport shouldn't be needed.