From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Multibyte and unibyte file names Date: Wed, 23 Jan 2013 15:38:51 -0800 Message-ID: <5100748B.80502@cs.ucla.edu> References: <83ehhbn680.fsf@gnu.org> <51002719.3080805@cs.ucla.edu> <83bocfn2k1.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1358984349 13600 80.91.229.3 (23 Jan 2013 23:39:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Jan 2013 23:39:09 +0000 (UTC) Cc: kzhr@d1.dion.ne.jp, michael.albinus@gmx.de, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 24 00:39:27 2013 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 1Ty9uc-0004oU-F3 for ged-emacs-devel@m.gmane.org; Thu, 24 Jan 2013 00:39:22 +0100 Original-Received: from localhost ([::1]:59453 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ty9uL-0004JV-26 for ged-emacs-devel@m.gmane.org; Wed, 23 Jan 2013 18:39:05 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:41610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ty9uE-0004JM-Cd for emacs-devel@gnu.org; Wed, 23 Jan 2013 18:39:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ty9uB-0003nU-70 for emacs-devel@gnu.org; Wed, 23 Jan 2013 18:38:58 -0500 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:53039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ty9u9-0003mt-Fe; Wed, 23 Jan 2013 18:38:53 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 709DDA60001; Wed, 23 Jan 2013 15:38:52 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wD7kdOCRa8u4; Wed, 23 Jan 2013 15:38:51 -0800 (PST) Original-Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 96B1D39E8100; Wed, 23 Jan 2013 15:38:51 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 In-Reply-To: <83bocfn2k1.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 131.179.128.62 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:156613 Archived-At: On 01/23/13 11:04, Eli Zaretskii wrote: > encoding a file name, > then removing its last "slash" as above, then decoding it again will > yield a wrong or even an invalid string, right? Yes, the code may be wrong for MS-Windows, but since the problem can't possibly occur in a POSIXish system, the code is correct as-is on POSIX. It's correct to always treat a '/' byte as a directory separator, no matter what the file name coding system is. This is de facto true already, and as I understand it the next version of POSIX will require this to be true for all encodings. Similarly, the next POSIX will guarantee that '.' always stands for itself, in any encoding.