From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#48902: 28.0.50; Directory names containing apostrophes and backticks cause problems Date: Tue, 8 Jun 2021 20:24:26 +0100 Message-ID: References: <51cb-60bf4900-1dd-2840bc80@23790836> <875yyoo9gy.fsf@gnus.org> <834ke8fs68.fsf@gnu.org> <83zgw0e9ou.fsf@gnu.org> <83lf7kdy8h.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24785"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 48902@debbugs.gnu.org, larsi@gnus.org, salutis@me.com, naofumi@yasufuku.dev To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 08 21:25:14 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqhLe-00069Z-8h for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 08 Jun 2021 21:25:14 +0200 Original-Received: from localhost ([::1]:39782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqhLc-00036k-JM for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 08 Jun 2021 15:25:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqhLS-00033X-St for bug-gnu-emacs@gnu.org; Tue, 08 Jun 2021 15:25:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48263) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lqhLS-0005Dn-Kx for bug-gnu-emacs@gnu.org; Tue, 08 Jun 2021 15:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lqhLS-0004Be-C3 for bug-gnu-emacs@gnu.org; Tue, 08 Jun 2021 15:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Jun 2021 19:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48902 X-GNU-PR-Package: emacs Original-Received: via spool by 48902-submit@debbugs.gnu.org id=B48902.162318028616068 (code B ref 48902); Tue, 08 Jun 2021 19:25:02 +0000 Original-Received: (at 48902) by debbugs.gnu.org; 8 Jun 2021 19:24:46 +0000 Original-Received: from localhost ([127.0.0.1]:59809 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lqhL8-0004Ay-07 for submit@debbugs.gnu.org; Tue, 08 Jun 2021 15:24:46 -0400 Original-Received: from outbound.soverin.net ([116.202.65.218]:33581) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lqhL2-0004Ab-7b for 48902@debbugs.gnu.org; Tue, 08 Jun 2021 15:24:40 -0400 Original-Received: from smtp.soverin.net (unknown [10.10.3.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id 841C16062D; Tue, 8 Jun 2021 19:24:30 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.142]) by soverin.net DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1623180269; bh=+GZEIJCDUmO7ZStcsBRU4vK7pOaDmOIHIvbxka9xhRA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=P1gzsS6ZCMa9EdNrfscFMuEKcxCLrq4v9HPTsk9kjVIYjYDYPeiikgEEEQe8ZpM09 fp1yzUaf+XfXIYPHwFyTXR1BR/s0R1O/qxt9vQbezcEDpKEwkdIO1cmZXebD5aL6gG enlDnwtIG7IvqqWlqRdc9sq4Fh+/z08nRvUFvSzYS8lX7h9ZMdu8DFBwonsPPS1iA0 uEjiQsNrs/KHfk0IkkdcjDdJUPsEgBtHG9rqgZWznmMz7ssE5is0o5JipvArjvm+NT x9fGODH54UqLoArUe9D7TXdJpjOlzs7wXguBjhbYrBLvwnpkdT+VZk2Rs6l6qWb2UC LAYr23dXsOJIg== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.94.2) (envelope-from ) id 1lqhKs-001ELe-7b; Tue, 08 Jun 2021 20:24:26 +0100 Mail-Followup-To: Alan Third , Eli Zaretskii , larsi@gnus.org, naofumi@yasufuku.dev, 48902@debbugs.gnu.org, salutis@me.com Content-Disposition: inline In-Reply-To: <83lf7kdy8h.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:208262 Archived-At: On Tue, Jun 08, 2021 at 09:09:51PM +0300, Eli Zaretskii wrote: > > Date: Tue, 8 Jun 2021 17:19:44 +0100 > > From: Alan Third > > Cc: larsi@gnus.org, naofumi@yasufuku.dev, 48902@debbugs.gnu.org, > > salutis@me.com > > > > In this case the call to ENCODE_FILE in allocInitFromFile is actually > > redundant because image_find_image_fd already calls ENCODE_FILE on the > > filename before passing it back. So we get a UTF-8 string no matter > > what. > > Then why was the code re-encoding t in UTF-16? A bug? No, sorry, I'm not being clear. The internal format of NSString is UTF-16. We can load practically anything into it, as long as we know ahead of time what the encoding is. > > NSString can read in almost anything, and Mattias extended it to read > > in multibyte (and ascii) lisp strings, so we don't need a UTF-16 input > > specifically. It would probably be nice if NSString was also able to > > recognise that a lisp string is UTF-8 and handle that itself, but I > > don't think that's really possible, unless we make the assumption that > > any unibyte string it's passed will already be ascii or UTF-8. > > > > I don't know if that's a reasonable assumption. > > Any file name passed through ENCODE_FILE should be in UTF-8 on macOS, > as I understand that's how the macOS filesystems work. Am I mistaken? > Can the value of default-file-name-coding-system on macOS be anything > other than UTF-8? Not as far as I'm aware. But NSString is used all over the place in the NS port code base (and all through the toolkit). Any time we pass a string to or from the toolkit it has to be converted to or from NSString. I think most of the actual file access code in Emacs is low level C code which won't go near NSString, though, so it's not worth changing C code to make ObjC code cleaner. I guess I'm just being lazy and would like our extensions to NSString to just DTRT, but it seems that's impractical. :) -- Alan Third