unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
Cc: emacs-devel@gnu.org
Subject: Re: dired doesn't work properly with a multibyte locale
Date: Mon, 27 Jan 2003 14:01:36 +0900 (JST)	[thread overview]
Message-ID: <200301270501.OAA14427@etlken.m17n.org> (raw)
In-Reply-To: <buoptqjb51e.fsf@mcspd15.ucom.lsi.nec.co.jp> (message from Miles Bader on 27 Jan 2003 13:17:01 +0900)

In article <buoptqjb51e.fsf@mcspd15.ucom.lsi.nec.co.jp>, Miles Bader <miles@lsi.nec.co.jp> 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

  reply	other threads:[~2003-01-27  5:01 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-06  6:04 dired doesn't work properly with a multibyte locale Miles Bader
2003-01-11 20:00 ` Stefan Monnier
2003-01-11 20:16   ` Miles Bader
2003-01-12 11:56 ` Richard Stallman
2003-01-15 10:43 ` Kenichi Handa
2003-01-15 23:30   ` Richard Stallman
2003-01-23  4:31   ` Miles Bader
2003-01-23  6:02     ` Kenichi Handa
2003-01-23  6:12       ` Miles Bader
2003-01-25  0:49         ` Kenichi Handa
2003-01-27  4:17           ` Miles Bader
2003-01-27  5:01             ` Kenichi Handa [this message]
2003-01-27 10:58               ` Andreas Schwab
2003-01-27 11:09                 ` Kenichi Handa
2003-01-27 12:15                   ` Andreas Schwab
2003-02-03  0:17                     ` Kenichi Handa
2003-02-03  1:24                       ` Miles Bader
2003-02-03  2:11                         ` Kenichi Handa
2003-02-03  2:22                           ` Miles Bader
2003-02-03  8:40                             ` Kenichi Handa
2003-02-03  9:02                               ` Miles Bader
2003-02-03  9:10                                 ` Kenichi Handa
2003-02-03  9:22                                   ` Miles Bader
2003-02-03  9:37                                     ` Jim Meyering
2003-02-03 11:00                                   ` Andreas Schwab
2003-02-03 11:17                                     ` Kenichi Handa
2003-02-13 13:58                                       ` Dave Love
2003-02-17  6:19                                         ` Kenichi Handa
2003-02-03 17:47                           ` Dave Love
2003-02-03 17:44                         ` Dave Love
2003-02-03 18:45                           ` Michael Livshin
2003-02-03 19:13                             ` Eli Zaretskii
2003-02-03  9:37                       ` Jim Meyering
2003-02-03 17:20                       ` Richard Stallman
2003-02-03 18:53                         ` Andreas Schwab
2003-01-27 10:56             ` Andreas Schwab
2003-01-27 13:35               ` Jim Meyering
2003-01-24  5:42     ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200301270501.OAA14427@etlken.m17n.org \
    --to=handa@m17n.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).