From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 7466a4d: Cygwin emacsclient handles w32 file names Date: Wed, 01 Jul 2015 18:47:55 +0300 Message-ID: <83twtn282c.fsf@gnu.org> References: <20150630005924.5663.80677@vcs.savannah.gnu.org> <5592018D.7070303@cornell.edu> <5593F5BC.4030602@cornell.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1435765715 11252 80.91.229.3 (1 Jul 2015 15:48:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Jul 2015 15:48:35 +0000 (UTC) Cc: michael@mauger.com, emacs-devel@gnu.org To: Ken Brown Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 01 17:48:27 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZAKFO-00073y-S0 for ged-emacs-devel@m.gmane.org; Wed, 01 Jul 2015 17:48:27 +0200 Original-Received: from localhost ([::1]:59680 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAKFO-0000eW-3Y for ged-emacs-devel@m.gmane.org; Wed, 01 Jul 2015 11:48:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAKEp-0000aR-Vb for emacs-devel@gnu.org; Wed, 01 Jul 2015 11:47:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAKEn-0008Dp-5G for emacs-devel@gnu.org; Wed, 01 Jul 2015 11:47:51 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:46607) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAKEm-0008DW-U2 for emacs-devel@gnu.org; Wed, 01 Jul 2015 11:47:49 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NQT00500FR6VA00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Wed, 01 Jul 2015 18:47:47 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NQT005HUFVMVN00@a-mtaout20.012.net.il>; Wed, 01 Jul 2015 18:47:47 +0300 (IDT) In-reply-to: <5593F5BC.4030602@cornell.edu> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:187698 Archived-At: > Date: Wed, 01 Jul 2015 10:14:20 -0400 > From: Ken Brown > Cc: emacs-devel@gnu.org > > I've tested this a little with file names containing UTF-8-encoded > Chinese and other non-ASCII characters, and it appears to work OK. But > I *think* it only works because of accidental implementation details of > cygwin-convert-file-name-from-windows (and the underlying Cygwin > function cygwin_conv_path). Basically, it seems that these functions > don't actually try to do any conversion if they are given a multibyte > string instead of the expected UTF-16 string. That was also my conclusion. > So even though this change *might* be harmless, I think it could lead to > bugs later if implementations change. I don't think > cygwin-convert-file-name-from-windows should be called on a file name > that is not known to be a (UTF-16-encoded) Windows file name. The UTF-16 encoding is not an issue, because cygwin-convert-file-name-from-windows calls to_unicode to ensure that. I think this code needs to look at the result of expand-file-name for the file and the default directory in effect, and check whether the result begins with a drive letter. If it does, it should call cygwin-convert-file-name-from-windows.