From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: sssslang 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 20:09:52 +0800 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: multipart/mixed; boundary="Apple-Mail=_334639BC-A43F-4B85-8E28-D5508C23FE1D" X-Trace: dough.gmane.org 1318435916 12046 80.91.229.12 (12 Oct 2011 16:11:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 12 Oct 2011 16:11:56 +0000 (UTC) To: 9735@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 12 18:11:52 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 1RE1PL-00083p-L9 for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Oct 2011 18:11:51 +0200 Original-Received: from localhost ([::1]:57242 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RE1PL-00006h-5X for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Oct 2011 12:11:51 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:52370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDy0E-0005AF-DF for bug-gnu-emacs@gnu.org; Wed, 12 Oct 2011 08:33:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RDy0D-0000xS-C7 for bug-gnu-emacs@gnu.org; Wed, 12 Oct 2011 08:33:42 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40670) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDy0D-0000xK-AP for bug-gnu-emacs@gnu.org; Wed, 12 Oct 2011 08:33:41 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RDy0Z-0007zA-IA for bug-gnu-emacs@gnu.org; Wed, 12 Oct 2011 08:34:03 -0400 X-Loop: help-debbugs@gnu.org 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: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.131842279130601 (code B ref -1); Wed, 12 Oct 2011 12:34:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 Oct 2011 12:33:11 +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 1RDxzj-0007xR-BL for submit@debbugs.gnu.org; Wed, 12 Oct 2011 08:33:11 -0400 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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= Original-Received: by 10.68.56.72 with SMTP id y8mr843502pbp.82.1318421401937; Wed, 12 Oct 2011 05:10:01 -0700 (PDT) Original-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) 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-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 Resent-Date: Wed, 12 Oct 2011 08:34:03 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-Mailman-Approved-At: Wed, 12 Oct 2011 12:11:48 -0400 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:52587 Archived-At: --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--