Re: [PATCH] Try URI quoting for embedded TAB and LF in pathnames
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:08
Linus Torvalds [off-list ref] writes:
This is really what my argument boils down to: character set encoding should _not_ EVER affect the _transfer_ of the data. It doesn't matter if something is latin1 or utf-8, the only thing that matters is the byte sequence. Only when you _display_ it should you try to figure out what the byte sequence possibly means. So I repeat: - escape as little as possible - make the _viewer_ decide how to view it.
I think the same argument can be made about patch application, although strictly speaking it is not "viewing". Let the patch program decide (or the user to tell her decision to the patch program) what the unescaped byte sequence in the patch that represents the path being affected is encoded in, and do something sensible while taking into account that the pathname encoding on the working tree may be different from what is recorded in the patch. For example, one of my partitions is ntfs mounted with nls=euc-jp, and I expect the tool to help me apply patches to a Japanese-named file when the patch is from a system with UTF-8 encoded filenames.