0

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.

JustAnotherDeveloper
  • 3,167
  • 11
  • 37
  • 68
Rob
  • 173
  • 1
  • 2
  • 12

1 Answers1

1

This is just a font issue. The editor apparently is more clever in picking a suitable font for the glyphs you have in the file name. For what it's worth, on Windows 7 both Far (using Consolas) and Explorer (using Segoe UI) have no problems displaying the file name correctly:

enter image description here enter image description here

But as noted, the data is correct; it's just a display issue.

Joey
  • 344,408
  • 85
  • 689
  • 683