From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel,gmane.comp.gnu.core-utils.bugs Subject: Re: dired doesn't work properly with a multibyte locale Date: Mon, 27 Jan 2003 14:01:36 +0900 (JST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200301270501.OAA14427@etlken.m17n.org> References: <200301151043.TAA09856@etlken.m17n.org> <200301230602.PAA07755@etlken.m17n.org> <200301250049.JAA11674@etlken.m17n.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: main.gmane.org 1043644223 12570 80.91.224.249 (27 Jan 2003 05:10:23 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 27 Jan 2003 05:10:23 +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 18d1XH-0003GG-00 for ; Mon, 27 Jan 2003 06:10:19 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18d1bJ-0007tW-00 for ; Mon, 27 Jan 2003 06:14:29 +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 18d1SK-0000cU-07 for emacs-devel@quimby.gnus.org; Mon, 27 Jan 2003 00:05:12 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18d1Qy-0000Cb-00 for emacs-devel@gnu.org; Mon, 27 Jan 2003 00:03:48 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18d1Ps-0008N1-00 for emacs-devel@gnu.org; Mon, 27 Jan 2003 00:03:06 -0500 Original-Received: from tsukuba.m17n.org ([192.47.44.130]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18d1PX-00089u-00; Mon, 27 Jan 2003 00:02:19 -0500 Original-Received: from fs.m17n.org (fs.m17n.org [192.47.44.2])h0R51ak13648; Mon, 27 Jan 2003 14:01:36 +0900 (JST) (envelope-from handa@m17n.org) Original-Received: from etlken.m17n.org (etlken.m17n.org [192.47.44.125]) h0R51aR17297; Mon, 27 Jan 2003 14:01:36 +0900 (JST) Original-Received: (from handa@localhost) by etlken.m17n.org (8.8.8+Sun/3.7W-2001040620) id OAA14427; Mon, 27 Jan 2003 14:01:36 +0900 (JST) Original-To: miles@gnu.org In-reply-to: (message from Miles Bader on 27 Jan 2003 13:17:01 +0900) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.2.92 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI) Original-cc: bug-coreutils@gnu.org Original-cc: emacs-pretest-bug@gnu.org 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:11116 gmane.comp.gnu.core-utils.bugs:87 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:11116 In article , Miles Bader writes: > Hmm, it actually seems to be a bug with `ls'! > I created two files, one called `abc\ndef' (where \n is a newline), and > one called `1234567'. Here's what ls prints if stdout is a tty (I've > indented the output by 3 spaces): > (tmp) LANG=ja_JP.eucJP ls -l --dired abc* 123* > -rw-rw---- 1 miles 6 2003-01-27 13:03 1234567 > -rw-rw---- 1 miles 6 2003-01-27 12:58 abc?def > //DIRED// 53 60 114 121 > //DIRED-OPTIONS// --quoting-style=literal > [note that the start/end offsets of each filename differ by 7] > But here's what the _same_ command prints if stdout is a pipe (which I > presume is the case for dired): > (tmp) LANG=ja_JP.eucJP ls -l --dired abc* 123* | cat > -rw-rw---- 1 miles 6 2003-01-27 13:03 1234567 > -rw-rw---- 1 miles 6 2003-01-27 12:58 abc > def > //DIRED// 53 60 114 120 > //DIRED-OPTIONS// --quoting-style=literal > Now the start/end offsets of `abc\ndef' now only differ by 6 (which is > obviously wrong, since the filename is 7 characters long)! Morever > this problem only seems to occur if LANG=ja_JP.eucJP, _not_ if LANG=C. > My ls --version says: ls (coreutils) 4.5.4 > What version do you have? Mine is "ls (fileutils) 4.1", and that works correctly even if the stdout is a pile in any locales as below. [~/tmp:709] LANG=ja_JP.eucJP \ls -l --dired abc* 123*|cat -rw-rw-r-- 1 handa handa 6 Jan 27 13:50 1234567 -rw-rw-r-- 1 handa handa 6 Jan 27 13:51 abc def //DIRED// 58 65 124 131 //DIRED-OPTIONS// --quoting-style=(null) [~/tmp:710] LANG=de_DE \ls -l --dired abc* 123*|cat -rw-rw-r-- 1 handa handa 6 Jan 27 13:50 1234567 -rw-rw-r-- 1 handa handa 6 Jan 27 13:51 abc def //DIRED// 58 65 124 131 //DIRED-OPTIONS// --quoting-style=(null) [~/tmp:711] LANG=C \ls -l --dired abc* 123*|cat -rw-rw-r-- 1 handa handa 6 Jan 27 13:50 1234567 -rw-rw-r-- 1 handa handa 6 Jan 27 13:51 abc def //DIRED// 58 65 124 131 //DIRED-OPTIONS// --quoting-style=(null) The difference with your case is in --quoting-style, I don't know that meaning. --- Ken'ichi HANDA handa@m17n.org