[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
dired doesn't work properly with a multibyte locale
From: |
Miles Bader |
Subject: |
dired doesn't work properly with a multibyte locale |
Date: |
06 Jan 2003 15:04:26 +0900 |
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....
- dired doesn't work properly with a multibyte locale,
Miles Bader <=