This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Filenames with Win32 special characters (or: Interix filename compatibility)


On Mar 11 19:27, Corinna Vinschen wrote:
> On Mar 11 09:55, Brian Dessent wrote:
> > But going through the entire list of combining characters, I
> > did find one with an interesting property: U+0331: COMBINING MACRON
> > BELOW.  When displayed in Explorer, it looks like the normal letter with
> > a small underline.  But the neat property of this character is that when
> > converted from Unicode to cp1252 it converts to the underscore, meaning
> > stupid ANSI programs can still edit/open/save these files.  So we'd
> > encode uppercase ascii as simply 'A' -> "A\x0331", 'B' -> "B\x0331" and
> > so on.  It doesn't have the property of the same length, but they still
> > remain intelligible in dumb apps.
> > 
> > (BTW, for a real hoot try creating a filename containing U+034F
> > COMBINING GRAPHEME JOINER.)
> 
> This approach sounds quite interesting!

Did I miss something?  I created a file with a special filename like this:

  #include <windows.h>

  int
  main ()
  {
    WCHAR fname[] = { L'C', L'F', L'W', 0x0331,
		      L'C', L'F', L'W', 0x034f, L'\0' };
    CreateFileW (fname, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
    return 0;
  }

I don't see that this filename is printed correctly according to the
meaning of these characters in Explorer on Windows XP.
Rather, it looks like all filenames with strange chars:

  CFW#CFW#

The hash character acting as this box char printed for unknown character
values.  If I switch the font, I can get a trailing underscore for the
0x0331 character.  I didn't find a font which shows this correctly as
half width underscore under the preceding character.  No font printed
the 0x034f character other than as a box.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]