This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: cygpath -w 'a"b'
- From: Warren Young <wyml at etr-usa dot com>
- To: The Cygwin Mailing List <cygwin at cygwin dot com>
- Date: Thu, 14 Jul 2016 09:24:13 -0600
- Subject: Re: cygpath -w 'a"b'
- Authentication-results: sourceware.org; auth=none
- References: <000b01d1dddd$174e66a0$45eb33e0$@gmail.com>
On Jul 14, 2016, at 8:36 AM, Brien Oberstein <brienpub@gmail.com> wrote:
>
> cygpath -w 'a"b' doesn't seem to translate the double quotes into a windows
> accesible file name.
Double quotes are illegal on NTFS:
https://msdn.microsoft.com/library/windows/desktop/aa365247.aspx
> what is the proper way to translate from cygwin
> filenames with special mapped characters (eg " and : )?
If you look at such a file name in Explorer, Cygwin (?) seems to be mapping double-quotes to U+F022, which is currently not defined within Unicode:
http://www.fileformat.info/info/unicode/char/f022/
That’s fine as far as Cygwin goes, but it still isn’t going to make native Windows programs believe that double-quotes are legal in file names.
While playing with all of this, I stumbled across an actual cygpath bug:
$ mkdir 'the "foo" directory’
$ cygpath -w 'the "foo" directory/' | od -c
0000000 t h e " f o o 357 200 242 d i r e
0000020 c t o r y \ \n
0000027
That is, it translates the second double-quote only.
Attempting something more like what Brien talks about also fails:
$ mkdir 'a"b'
$ explorer 'a"b' # opens my Documents folder!
$ explorer "$(cygpath -w 'a"b')" # ditto
$ explorer $(echo -e "a\xEF\x80\xA2b") # opens expected folder
Strange stuff.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple