From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.bugs Subject: bug#13907: 24.3.50; cygw32 build mishandles drag-n-dropped file with non-ASCII characters in name Date: Fri, 08 Mar 2013 16:03:25 -0500 Message-ID: <513A521D.9090902@cornell.edu> References: <513A1D4D.5060908@cornell.edu> <8338w5zni7.fsf@gnu.org> <83vc91y6m4.fsf@gnu.org> <83txoly5ov.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1362776678 30663 80.91.229.3 (8 Mar 2013 21:04:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Mar 2013 21:04:38 +0000 (UTC) Cc: 13907@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 08 22:05:00 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1UE4TK-00021f-Sv for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Mar 2013 22:04:59 +0100 Original-Received: from localhost ([::1]:47256 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UE4Sy-0004dH-Pj for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Mar 2013 16:04:36 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UE4Sq-0004bV-PN for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2013 16:04:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UE4Sl-0002Qu-Ps for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2013 16:04:28 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35951) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UE4Sl-0002Qn-MH for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2013 16:04:23 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UE4TO-00025a-FP for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2013 16:05:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Mar 2013 21:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13907 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13907-submit@debbugs.gnu.org id=B13907.13627766697992 (code B ref 13907); Fri, 08 Mar 2013 21:05:02 +0000 Original-Received: (at 13907) by debbugs.gnu.org; 8 Mar 2013 21:04:29 +0000 Original-Received: from localhost ([127.0.0.1]:40060 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UE4Sq-00024p-Ki for submit@debbugs.gnu.org; Fri, 08 Mar 2013 16:04:28 -0500 Original-Received: from limestone3.mail.cornell.edu ([128.253.83.163]:36083) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UE4Sn-00024d-Ti for 13907@debbugs.gnu.org; Fri, 08 Mar 2013 16:04:26 -0500 X-CornellRouted: This message has been Routed already. Original-Received: from authusersmtp.mail.cornell.edu ([10.16.197.8]) by limestone3.mail.cornell.edu (8.14.4/8.14.4) with ESMTP id r28L3S6Z004293; Fri, 8 Mar 2013 16:03:29 -0500 (EST) Original-Received: from [192.168.1.6] (cpe-67-249-194-47.twcny.res.rr.com [67.249.194.47]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id r28L3WGi011703 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 8 Mar 2013 16:03:33 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 In-Reply-To: <83txoly5ov.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:72246 Archived-At: On 3/8/2013 3:53 PM, Eli Zaretskii wrote: >> Date: Fri, 08 Mar 2013 22:33:07 +0200 >> From: Eli Zaretskii >> Cc: 13907@debbugs.gnu.org >> >> And one more question: what is the value of file-name _before_ it is >> passed to cygwin-convert-file-name-from-windows? Does it perhaps >> already have the U-umlaut replaced by a blank? > > I think the problem is on the C level, not on the Lisp level. Take a > look at w32term.c:construct_drag_n_drop -- it uses ANSI version of > DragQueryFile to get the file name, then decodes it by DECODE_FILE. > But DECODE_FILE uses UTF-8 in the cygw32 build, so this is > inappropriate for decoding file names that come from Windows APIs. > > Instead, in the cygw32 build, construct_drag_n_drop should use > DragQueryFileW and convert the file name to the internal Emacs > representation using from_unicode. Thanks! You solved it while I was trying to get the answers to your questions. For the record, here's what happens in my example: The value of file-name that is passed to cygwin-convert-file-name-from-windows is "C:\\cygwin\\tmp\\\334.txt". The converted file name is then "/tmp/ .txt". I'll leave it to Daniel to fix this, since it's his code. Thanks again, Eli. Ken