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#9735: win32 emacs cannot load doc string from files which has non-ascii characters in path Date: Wed, 12 Oct 2011 15:08:12 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1318446530 25771 80.91.229.12 (12 Oct 2011 19:08:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 12 Oct 2011 19:08:50 +0000 (UTC) Cc: 9735-done@debbugs.gnu.org To: sssslang Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 12 21:08:45 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RE4AX-0001ny-82 for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Oct 2011 21:08:45 +0200 Original-Received: from localhost ([::1]:56865 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RE4AW-0004xP-Nd for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Oct 2011 15:08:44 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:58297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RE4AT-0004sq-AF for bug-gnu-emacs@gnu.org; Wed, 12 Oct 2011 15:08:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RE4AQ-00061F-T9 for bug-gnu-emacs@gnu.org; Wed, 12 Oct 2011 15:08:41 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RE4AQ-000619-RP for bug-gnu-emacs@gnu.org; Wed, 12 Oct 2011 15:08:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RE4Ao-0005LW-QM for bug-gnu-emacs@gnu.org; Wed, 12 Oct 2011 15:09:02 -0400 Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 Oct 2011 19:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 9735 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 9735@debbugs.gnu.org, monnier@IRO.UMontreal.CA Original-Received: via spool by 9735-done@debbugs.gnu.org id=D9735.131844653720527 (code D ref 9735); Wed, 12 Oct 2011 19:09:02 +0000 Original-Received: (at 9735-done) by debbugs.gnu.org; 12 Oct 2011 19:08:57 +0000 Original-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 Original-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 Original-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 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id E72D71300F2; Wed, 12 Oct 2011 15:08:13 -0400 (EDT) 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) 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 12 Oct 2011 15:09:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:52608 Archived-At: > 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); > }