From unknown Sun Jun 22 07:40:01 2025 X-Loop: help-debbugs@gnu.org Subject: bug#9735: win32 emacs cannot load doc string from files which has non-ascii characters in path Resent-From: sssslang Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 Oct 2011 12:34:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 9735 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 9735@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.131842279130601 (code B ref -1); Wed, 12 Oct 2011 12:34:03 +0000 Received: (at submit) by debbugs.gnu.org; 12 Oct 2011 12:33:11 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RDxzj-0007xR-BL for submit@debbugs.gnu.org; Wed, 12 Oct 2011 08:33:11 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RDxdw-0007PQ-BY for submit@debbugs.gnu.org; Wed, 12 Oct 2011 08:10:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RDxdT-00033U-Ra for submit@debbugs.gnu.org; Wed, 12 Oct 2011 08:10:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HK_RANDOM_ENVFROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:53525) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDxdT-00033O-Q0 for submit@debbugs.gnu.org; Wed, 12 Oct 2011 08:10:11 -0400 Received: from eggs.gnu.org ([140.186.70.92]:35987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDxdP-0001e0-Ny for bug-gnu-emacs@gnu.org; Wed, 12 Oct 2011 08:10:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RDxdL-0002yF-K3 for bug-gnu-emacs@gnu.org; Wed, 12 Oct 2011 08:10:07 -0400 Received: from mail-vw0-f41.google.com ([209.85.212.41]:63049) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDxdL-0002y9-HV for bug-gnu-emacs@gnu.org; Wed, 12 Oct 2011 08:10:03 -0400 Received: by vws16 with SMTP id 16so583416vws.0 for ; Wed, 12 Oct 2011 05:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:content-type:subject:date:message-id:to:mime-version:x-mailer; bh=GiMgGEDXDBssV0oe6AZCdsVa5LWHTKXJqVpPtvsIe00=; b=xbPNbGjgy2iU3L91KfzRuqKx4IwaDZxXNE1VtfymC72yQ8eS75Ari1gdi0rO4ywHFm AGUqNgR0kt/Dgr3aIAamg19jpY4vLBzDjzeUyoSaZZ57zpnzYTKp2PbfZcXzbVraFZtw QGA+ricHtnIp+ymqsAbRn74jfUFKxB3IlzSVg= Received: by 10.68.56.72 with SMTP id y8mr843502pbp.82.1318421401937; Wed, 12 Oct 2011 05:10:01 -0700 (PDT) Received: from [192.168.1.11] ([123.116.136.36]) by mx.google.com with ESMTPS id w4sm7028977pbf.6.2011.10.12.05.09.54 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Oct 2011 05:10:00 -0700 (PDT) From: sssslang Content-Type: multipart/mixed; boundary="Apple-Mail=_334639BC-A43F-4B85-8E28-D5508C23FE1D" Date: Wed, 12 Oct 2011 20:09:52 +0800 Message-Id: Mime-Version: 1.0 (Apple Message framework v1244.3) X-Mailer: Apple Mail (2.1244.3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.9 (-----) X-Mailman-Approved-At: Wed, 12 Oct 2011 08:33:09 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) --Apple-Mail=_334639BC-A43F-4B85-8E28-D5508C23FE1D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hello everyone. I found my emacs cannot start when I put it in a folder = with a non-latin name under Windows XP. This can be reproduced by the = following steps: 1. make path to emacs.exe contains some non-latin characters 2. execute: emacs.exe -Q 3. (require 'cl) Then an error message will appear: Debugger entered--Lisp error: (error "Cannot open doc string file = \"c:/xxxxx/eamacs23/lisp/emacs-lisp/cl.elc\"") cl-random-time() I use emacs-23.2 and codepage936 on my Windows box. And the "xxxxx" in = the error message should be the non-latin characters but is something = like "\301\226" now. Except "cl" and "calendar", other elisp sources = seems can be loaded without problem. I don't know what makes the = difference, but the error maybe caused by incorrect path encoding. The = attached patch works on my machine, but it didn't have enough test. = Hopes somebody could improve it. --Apple-Mail=_334639BC-A43F-4B85-8E28-D5508C23FE1D Content-Disposition: attachment; filename=emacs_win32_pathenc.path Content-Type: application/octet-stream; name="emacs_win32_pathenc.path" Content-Transfer-Encoding: 7bit --- emacs-23.2/src/doc.c 2010-04-04 06:26:07.000000000 +0800 +++ emacs-23.2/src/doc.c 2011-10-12 17:19:54.000000000 +0800 @@ -142,17 +142,17 @@ tem = Ffile_name_absolute_p (file); if (NILP (tem)) { - minsize = SCHARS (Vdoc_directory); + minsize = SCHARS (ENCODE_FILE (Vdoc_directory)); /* sizeof ("../etc/") == 8 */ if (minsize < 8) minsize = 8; - name = (char *) alloca (minsize + SCHARS (file) + 8); - strcpy (name, SDATA (Vdoc_directory)); - strcat (name, SDATA (file)); + name = (char *) alloca (minsize + SCHARS (ENCODE_FILE (file)) + 8); + strcpy (name, SDATA (ENCODE_FILE (Vdoc_directory))); + strcat (name, SDATA (ENCODE_FILE (file))); } else { - name = (char *) SDATA (file); + name = (char *) SDATA (ENCODE_FILE(file)); } fd = emacs_open (name, O_RDONLY, 0); @@ -164,7 +164,7 @@ /* Preparing to dump; DOC file is probably not installed. So check in ../etc. */ strcpy (name, "../etc/"); - strcat (name, SDATA (file)); + strcat (name, SDATA (ENCODE_FILE (file))); fd = emacs_open (name, O_RDONLY, 0); } --Apple-Mail=_334639BC-A43F-4B85-8E28-D5508C23FE1D-- From unknown Sun Jun 22 07:40:01 2025 X-Loop: help-debbugs@gnu.org Subject: bug#9735: win32 emacs cannot load doc string from files which has non-ascii characters in path Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 Oct 2011 16:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9735 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: sssslang Cc: 9735@debbugs.gnu.org Received: via spool by 9735-submit@debbugs.gnu.org id=B9735.131843692129302 (code B ref 9735); Wed, 12 Oct 2011 16:29:02 +0000 Received: (at 9735) by debbugs.gnu.org; 12 Oct 2011 16:28:41 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RE1fc-0007cY-PV for submit@debbugs.gnu.org; Wed, 12 Oct 2011 12:28:41 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RE1fZ-0007cQ-Ny for 9735@debbugs.gnu.org; Wed, 12 Oct 2011 12:28:38 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RE1fB-0004sb-FT; Wed, 12 Oct 2011 12:28:13 -0400 From: Glenn Morris References: X-Spook: electronic surveillance Medco Elvis Bruxelles Commecen X-Ran: "ctekZ@Z[Y23c;_hYV>;rM}ziYrpG4*hK3\rDcI{30C].rnz|$\+8DLuve('6LV?V/:6'5 X-Hue: magenta X-Attribution: GM Date: Wed, 12 Oct 2011 12:28:13 -0400 In-Reply-To: (sssslang@gmail.com's message of "Wed, 12 Oct 2011 20:09:52 +0800") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.4 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.4 (------) sssslang wrote: > Except "cl" and "calendar", other elisp sources seems can be loaded > without problem. The common factor here is probably that these are files that use `byte-compile-dynamic: t'. From unknown Sun Jun 22 07:40:01 2025 X-Loop: help-debbugs@gnu.org Subject: bug#9735: win32 emacs cannot load doc string from files which has non-ascii characters in path Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 Oct 2011 16:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9735 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: sssslang Cc: 9735@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 9735-submit@debbugs.gnu.org id=B9735.131843741130114 (code B ref 9735); Wed, 12 Oct 2011 16:37:01 +0000 Received: (at 9735) by debbugs.gnu.org; 12 Oct 2011 16:36:51 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RE1nW-0007pf-Tk for submit@debbugs.gnu.org; Wed, 12 Oct 2011 12:36:51 -0400 Received: from mtaout23.012.net.il ([80.179.55.175]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RE1nV-0007pQ-3w for 9735@debbugs.gnu.org; Wed, 12 Oct 2011 12:36:50 -0400 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0LSY00B00OFS9R00@a-mtaout23.012.net.il> for 9735@debbugs.gnu.org; Wed, 12 Oct 2011 18:36:18 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.127.51.78]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LSY00BI1OSH6380@a-mtaout23.012.net.il>; Wed, 12 Oct 2011 18:36:18 +0200 (IST) Date: Wed, 12 Oct 2011 18:36:19 +0200 From: Eli Zaretskii In-reply-to: X-012-Sender: halo1@inter.net.il Message-id: <838voq416k.fsf@gnu.org> References: X-Spam-Score: -1.7 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.7 (-) > From: sssslang > Date: Wed, 12 Oct 2011 20:09:52 +0800 > > 1. make path to emacs.exe contains some non-latin characters > 2. execute: emacs.exe -Q > 3. (require 'cl) > > Then an error message will appear: > > Debugger entered--Lisp error: (error "Cannot open doc string file \"c:/xxxxx/eamacs23/lisp/emacs-lisp/cl.elc\"") > cl-random-time() > > I use emacs-23.2 and codepage936 on my Windows box. And the "xxxxx" in the error message should be the non-latin characters but is something like "\301\226" now. Except "cl" and "calendar", other elisp sources seems can be loaded without problem. I don't know what makes the difference, but the error maybe caused by incorrect path encoding. The attached patch works on my machine, but it didn't have enough test. Hopes somebody could improve it. Does it help to type C-x RET F cp936 RET before you evaluate "(require 'cl)" ? From unknown Sun Jun 22 07:40:01 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: sssslang Subject: bug#9735: closed (Re: bug#9735: win32 emacs cannot load doc string from files which has non-ascii characters in path) Message-ID: References: X-Gnu-PR-Message: they-closed 9735 X-Gnu-PR-Package: emacs Reply-To: 9735@debbugs.gnu.org Date: Wed, 12 Oct 2011 19:09:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1318446542-20547-1" This is a multi-part message in MIME format... ------------=_1318446542-20547-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #9735: win32 emacs cannot load doc string from files which has non-ascii ch= aracters in path which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 9735@debbugs.gnu.org. --=20 9735: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D9735 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1318446542-20547-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 9735-done) by debbugs.gnu.org; 12 Oct 2011 19:08:57 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RE4Aj-0005L2-5Q for submit@debbugs.gnu.org; Wed, 12 Oct 2011 15:08:57 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RE4Ag-0005Kd-IV for 9735-done@debbugs.gnu.org; Wed, 12 Oct 2011 15:08:55 -0400 Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id p9CJ8J06021686; Wed, 12 Oct 2011 15:08:19 -0400 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id E72D71300F2; Wed, 12 Oct 2011 15:08:13 -0400 (EDT) From: Stefan Monnier To: sssslang Subject: Re: bug#9735: win32 emacs cannot load doc string from files which has non-ascii characters in path Message-ID: References: Date: Wed, 12 Oct 2011 15:08:12 -0400 In-Reply-To: (sssslang@gmail.com's message of "Wed, 12 Oct 2011 20:09:52 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4008=0 X-NAI-Spam-Version: 2.2.0.9286 : core <4008> : streams <690790> : uri <981849> X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: 9735-done Cc: 9735-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.1 (----) > I use emacs-23.2 and codepage936 on my Windows box. And the "xxxxx" in the > error message should be the non-latin characters but is something like > "\301\226" now. Except "cl" and "calendar", other elisp sources seems can be > loaded without problem. I don't know what makes the difference, but the > error maybe caused by incorrect path encoding. The attached patch works on > my machine, but it didn't have enough test. Hopes somebody could improve it. The patch is doing the right thing, thank you. I installed a slightly different one to call ENCODE_FILE fewer times. Stefan > --- emacs-23.2/src/doc.c 2010-04-04 06:26:07.000000000 +0800 > +++ emacs-23.2/src/doc.c 2011-10-12 17:19:54.000000000 +0800 > @@ -142,17 +142,17 @@ > tem = Ffile_name_absolute_p (file); > if (NILP (tem)) > { > - minsize = SCHARS (Vdoc_directory); > + minsize = SCHARS (ENCODE_FILE (Vdoc_directory)); > /* sizeof ("../etc/") == 8 */ > if (minsize < 8) > minsize = 8; > - name = (char *) alloca (minsize + SCHARS (file) + 8); > - strcpy (name, SDATA (Vdoc_directory)); > - strcat (name, SDATA (file)); > + name = (char *) alloca (minsize + SCHARS (ENCODE_FILE (file)) + 8); > + strcpy (name, SDATA (ENCODE_FILE (Vdoc_directory))); > + strcat (name, SDATA (ENCODE_FILE (file))); > } > else > { > - name = (char *) SDATA (file); > + name = (char *) SDATA (ENCODE_FILE(file)); > } > fd = emacs_open (name, O_RDONLY, 0); > @@ -164,7 +164,7 @@ > /* Preparing to dump; DOC file is probably not installed. > So check in ../etc. */ > strcpy (name, "../etc/"); > - strcat (name, SDATA (file)); > + strcat (name, SDATA (ENCODE_FILE (file))); > fd = emacs_open (name, O_RDONLY, 0); > } ------------=_1318446542-20547-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 12 Oct 2011 12:33:11 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RDxzj-0007xR-BL for submit@debbugs.gnu.org; Wed, 12 Oct 2011 08:33:11 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RDxdw-0007PQ-BY for submit@debbugs.gnu.org; Wed, 12 Oct 2011 08:10:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RDxdT-00033U-Ra for submit@debbugs.gnu.org; Wed, 12 Oct 2011 08:10:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HK_RANDOM_ENVFROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:53525) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDxdT-00033O-Q0 for submit@debbugs.gnu.org; Wed, 12 Oct 2011 08:10:11 -0400 Received: from eggs.gnu.org ([140.186.70.92]:35987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDxdP-0001e0-Ny for bug-gnu-emacs@gnu.org; Wed, 12 Oct 2011 08:10:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RDxdL-0002yF-K3 for bug-gnu-emacs@gnu.org; Wed, 12 Oct 2011 08:10:07 -0400 Received: from mail-vw0-f41.google.com ([209.85.212.41]:63049) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDxdL-0002y9-HV for bug-gnu-emacs@gnu.org; Wed, 12 Oct 2011 08:10:03 -0400 Received: by vws16 with SMTP id 16so583416vws.0 for ; Wed, 12 Oct 2011 05:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:content-type:subject:date:message-id:to:mime-version:x-mailer; bh=GiMgGEDXDBssV0oe6AZCdsVa5LWHTKXJqVpPtvsIe00=; b=xbPNbGjgy2iU3L91KfzRuqKx4IwaDZxXNE1VtfymC72yQ8eS75Ari1gdi0rO4ywHFm AGUqNgR0kt/Dgr3aIAamg19jpY4vLBzDjzeUyoSaZZ57zpnzYTKp2PbfZcXzbVraFZtw QGA+ricHtnIp+ymqsAbRn74jfUFKxB3IlzSVg= Received: by 10.68.56.72 with SMTP id y8mr843502pbp.82.1318421401937; Wed, 12 Oct 2011 05:10:01 -0700 (PDT) Received: from [192.168.1.11] ([123.116.136.36]) by mx.google.com with ESMTPS id w4sm7028977pbf.6.2011.10.12.05.09.54 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Oct 2011 05:10:00 -0700 (PDT) From: sssslang Content-Type: multipart/mixed; boundary="Apple-Mail=_334639BC-A43F-4B85-8E28-D5508C23FE1D" Subject: win32 emacs cannot load doc string from files which has non-ascii characters in path Date: Wed, 12 Oct 2011 20:09:52 +0800 Message-Id: To: bug-gnu-emacs@gnu.org Mime-Version: 1.0 (Apple Message framework v1244.3) X-Mailer: Apple Mail (2.1244.3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 12 Oct 2011 08:33:09 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) --Apple-Mail=_334639BC-A43F-4B85-8E28-D5508C23FE1D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hello everyone. I found my emacs cannot start when I put it in a folder = with a non-latin name under Windows XP. This can be reproduced by the = following steps: 1. make path to emacs.exe contains some non-latin characters 2. execute: emacs.exe -Q 3. (require 'cl) Then an error message will appear: Debugger entered--Lisp error: (error "Cannot open doc string file = \"c:/xxxxx/eamacs23/lisp/emacs-lisp/cl.elc\"") cl-random-time() I use emacs-23.2 and codepage936 on my Windows box. And the "xxxxx" in = the error message should be the non-latin characters but is something = like "\301\226" now. Except "cl" and "calendar", other elisp sources = seems can be loaded without problem. I don't know what makes the = difference, but the error maybe caused by incorrect path encoding. The = attached patch works on my machine, but it didn't have enough test. = Hopes somebody could improve it. --Apple-Mail=_334639BC-A43F-4B85-8E28-D5508C23FE1D Content-Disposition: attachment; filename=emacs_win32_pathenc.path Content-Type: application/octet-stream; name="emacs_win32_pathenc.path" Content-Transfer-Encoding: 7bit --- emacs-23.2/src/doc.c 2010-04-04 06:26:07.000000000 +0800 +++ emacs-23.2/src/doc.c 2011-10-12 17:19:54.000000000 +0800 @@ -142,17 +142,17 @@ tem = Ffile_name_absolute_p (file); if (NILP (tem)) { - minsize = SCHARS (Vdoc_directory); + minsize = SCHARS (ENCODE_FILE (Vdoc_directory)); /* sizeof ("../etc/") == 8 */ if (minsize < 8) minsize = 8; - name = (char *) alloca (minsize + SCHARS (file) + 8); - strcpy (name, SDATA (Vdoc_directory)); - strcat (name, SDATA (file)); + name = (char *) alloca (minsize + SCHARS (ENCODE_FILE (file)) + 8); + strcpy (name, SDATA (ENCODE_FILE (Vdoc_directory))); + strcat (name, SDATA (ENCODE_FILE (file))); } else { - name = (char *) SDATA (file); + name = (char *) SDATA (ENCODE_FILE(file)); } fd = emacs_open (name, O_RDONLY, 0); @@ -164,7 +164,7 @@ /* Preparing to dump; DOC file is probably not installed. So check in ../etc. */ strcpy (name, "../etc/"); - strcat (name, SDATA (file)); + strcat (name, SDATA (ENCODE_FILE (file))); fd = emacs_open (name, O_RDONLY, 0); } --Apple-Mail=_334639BC-A43F-4B85-8E28-D5508C23FE1D-- ------------=_1318446542-20547-1--