From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: dired doesn't work properly with a multibyte locale Date: 06 Jan 2003 15:04:26 +0900 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: Reply-To: Miles Bader NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1041833114 16460 80.91.224.249 (6 Jan 2003 06:05:14 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 6 Jan 2003 06:05:14 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18VQNr-0004Gt-00 for ; Mon, 06 Jan 2003 07:05:11 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18VQRn-0005js-00 for ; Mon, 06 Jan 2003 07:09:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18VQNj-0002Ar-01 for emacs-devel@quimby.gnus.org; Mon, 06 Jan 2003 01:05:03 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18VQNK-0002Aa-00 for emacs-devel@gnu.org; Mon, 06 Jan 2003 01:04:38 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18VQNI-0002AP-00 for emacs-devel@gnu.org; Mon, 06 Jan 2003 01:04:37 -0500 Original-Received: from tyo201.gate.nec.co.jp ([210.143.35.51]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18VQNH-00025r-00; Mon, 06 Jan 2003 01:04:35 -0500 Original-Received: from mailgate3.nec.co.jp ([10.7.69.192])h0664Uw17590; Mon, 6 Jan 2003 15:04:30 +0900 (JST) Original-Received: from mailsv.nec.co.jp (mailgate52.nec.co.jp [10.7.69.198]) by mailgate3.nec.co.jp (8.11.6/3.7W-MAILGATE-NEC) with ESMTP id h0664Ti21660; Mon, 6 Jan 2003 15:04:29 +0900 (JST) Original-Received: from mcsss2.ucom.lsi.nec.co.jp ([10.30.114.133]) by mailsv.nec.co.jp (8.11.6/3.7W-MAILSV-NEC) with ESMTP id h0664Sq22609; Mon, 6 Jan 2003 15:04:28 +0900 (JST) Original-Received: from mcspd15.ucom.lsi.nec.co.jp (mcspd15 [10.30.114.174]) id h0664RB25579; Mon, 6 Jan 2003 15:04:27 +0900 (JST) Original-Received: by mcspd15.ucom.lsi.nec.co.jp (Postfix, from userid 31295) id DD2E93745; Mon, 6 Jan 2003 15:04:26 +0900 (JST) Original-To: emacs-pretest-bug@gnu.org System-Type: i686-pc-linux-gnu Blat: Foop Original-Lines: 24 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:10523 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:10523 I'm now using a multibyte locale (LANG=ja_JP.eucJP), and dired is screwed up: it can't properly find filenames in the directory listing. The reason seems to be that dired uses `ls --dired', which encodes the positions of filenames as byte-offsets into the ls output. However, my system's `ls' program sees the non-C LANG, and so the `total' line at the beginning of the ls output is now a multibyte-encoded word. Emacs decodes this fine, but the number of characters in the decoded word is _not_ the same as the number of bytes in the original ls output, so all the offsets from --dired are wrong. [note that if there are multibyte-encoded filenames, the offsets will get screwed up further later in the listing] It doesn't seem simple to get the byte offset information, so perhaps the best thing to do is simply not use --dired if `file-name-coding-system' is a multibyte encoding. That change is simple to make in dired (and I just manually set `dired-use-ls-dired' to nil), but I'm not sure how to tell if a particular coding system is multibyte or not. It'd be nice if there was a function like `coding-system-multibyte-p'... Thanks, -Miles -- We live, as we dream -- alone....