From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Why does dired go through extra efforts to avoid unibyte names Date: Wed, 03 Jan 2018 15:09:06 -0500 Message-ID: References: <83lghlfinq.fsf@gnu.org> <83tvw3asgk.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1515010108 31359 195.159.176.226 (3 Jan 2018 20:08:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 3 Jan 2018 20:08:28 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 03 21:08:24 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eWpKh-0007PW-H6 for ged-emacs-devel@m.gmane.org; Wed, 03 Jan 2018 21:08:15 +0100 Original-Received: from localhost ([::1]:35362 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWpMg-0002M8-AM for ged-emacs-devel@m.gmane.org; Wed, 03 Jan 2018 15:10:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWpM3-0002Lf-Mu for emacs-devel@gnu.org; Wed, 03 Jan 2018 15:09:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eWpM0-000471-Hq for emacs-devel@gnu.org; Wed, 03 Jan 2018 15:09:39 -0500 Original-Received: from [195.159.176.226] (port=37223 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eWpM0-00046K-AK for emacs-devel@gnu.org; Wed, 03 Jan 2018 15:09:36 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1eWpJn-0003zL-La for emacs-devel@gnu.org; Wed, 03 Jan 2018 21:07:19 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 20 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:g85cFrMIxTAASPQQbZ5rBNiQq08= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:221558 Archived-At: > Eight-bit-* characters are not in general modified by encoding them, > so you could encode them any number of times and still get the same > bytes as result. Agreed. But even if it were not the case, I don't see why that would explain the presence of this code. >> > As for the reason for using string-to-multibyte: maybe it's because we >> > use concat further down in the function, which will determine whether >> > the result will be unibyte or multibyte according to its own ideas of >> > what's TRT? >> But `concat` will do a string-to-multibyte for us, if needed > Not if the other concatenated parts are ASCII (which tend to be > unibyte strings). But that's still perfectly fine as well since it will then result in a unibyte string which will get "encoded" correctly. Stefan