cygpath -w 'a"b'
Warren Young
wyml@etr-usa.com
Thu Jul 14 15:24:00 GMT 2016
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
More information about the Cygwin
mailing list