From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#15260: cannot build in a directory with non-ascii characters Date: Thu, 31 Oct 2013 15:24:57 -0400 Message-ID: References: <83bo2dgq36.fsf@gnu.org> <837gd1gpcz.fsf@gnu.org> <8361slgnhk.fsf@gnu.org> <83zjpwfp3l.fsf@gnu.org> <83mwlug0cd.fsf@gnu.org> <83bo2af4hh.fsf@gnu.org> <8361shfil7.fsf@gnu.org> <834n81fdp8.fsf@gnu.org> <83zjpseo1g.fsf@gnu.org> <838uxaei43.fsf@gnu.org> <831u32drtn.fsf@gnu.org> <83sivhcodj.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1383247580 23107 80.91.229.3 (31 Oct 2013 19:26:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Oct 2013 19:26:20 +0000 (UTC) Cc: 15260@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 31 20:26:22 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 1Vbxsr-0003YX-Ik for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Oct 2013 20:26:21 +0100 Original-Received: from localhost ([::1]:58963 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vbxsr-0006A8-3E for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Oct 2013 15:26:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vbxsh-0006A2-7P for bug-gnu-emacs@gnu.org; Thu, 31 Oct 2013 15:26:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbxsZ-0008Mf-Tc for bug-gnu-emacs@gnu.org; Thu, 31 Oct 2013 15:26:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbxsZ-0008MW-Q2 for bug-gnu-emacs@gnu.org; Thu, 31 Oct 2013 15:26:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VbxsY-00024i-FY for bug-gnu-emacs@gnu.org; Thu, 31 Oct 2013 15:26:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 31 Oct 2013 19:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15260 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15260-submit@debbugs.gnu.org id=B15260.13832475087903 (code B ref 15260); Thu, 31 Oct 2013 19:26:02 +0000 Original-Received: (at 15260) by debbugs.gnu.org; 31 Oct 2013 19:25:08 +0000 Original-Received: from localhost ([127.0.0.1]:55476 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vbxrd-00023L-HT for submit@debbugs.gnu.org; Thu, 31 Oct 2013 15:25:06 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:29119) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vbxrb-00022s-Hz for 15260@debbugs.gnu.org; Thu, 31 Oct 2013 15:25:03 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFsoXfp/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kLodwBsEtkQoDpHqBXoMT X-IPAS-Result: Av4EABK/CFFsoXfp/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kLodwBsEtkQoDpHqBXoMT X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="36789424" Original-Received: from 108-161-119-233.dsl.teksavvy.com (HELO pastel.home) ([108.161.119.233]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 31 Oct 2013 15:24:57 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id A1341611E1; Thu, 31 Oct 2013 15:24:57 -0400 (EDT) In-Reply-To: <83sivhcodj.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 31 Oct 2013 19:59:52 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.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:79833 Archived-At: > Below is what I came up with. This survived several bootstraps, both Thanks, Eli. > +;; Make sure default-directory is unibyte when dumping. This is > +;; because we cannot decode and encode it correctly (since the locale > +;; environment is not, and should not be, set up). default-directory > +;; is used every time we call expand-file-name, which we do in every > +;; file primitive. So the only workable solution to support building > +;; in non-ASCII directories is to manipulate unibyte strings in the > +;; current locale's encoding. > +(if (and (or (equal (nth 3 command-line-args) "dump") > + (equal (nth 4 command-line-args) "dump") > + (equal (nth 3 command-line-args) "bootstrap") > + (equal (nth 4 command-line-args) "bootstrap")) > + (multibyte-string-p default-directory)) > + (setq default-directory (string-to-unibyte default-directory))) I'm not sure I understand this string-to-unibyte. This call seems to only be correct if default-directory holds the undecoded but multibyte name. Why would we have an undecided yet multibyte name? IOW, I'd expect here to either have default-directory be unibyte already, or be multibyte but encoded in some (arbitrary) encoding (in which case we can't really know how to re-encode it). Stefan