-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to DR. Lee - NS1 on 5/1/2007 9:40 PM:
> Dear Sir,
> 
> With the popularity of MS, I have to upload MS file to the Linux
> sometime. For a filename with Chinese character I found the odd behavior
> and maybe you can throw some light into what could be the reason.
> 
> 1) The ls -l command shown something like this:
> 
> -rw-rw----  1 penit_yuzhu penit 23552 Apr 30 15:20 Date????.doc
> -rw-r--r--  1 penit_yuzhu root    202 May  2 10:59 Test&ZeVnHw-.doc
>   

By default, ls will print ? in place of non-printable characters,
according to your current locale's definition of printable characters.
Either change your locale to something that prints those Chinese
characters, or look into using the --show-control-chars and
- --quoting-style options of ls to force these characters to print.

> 
> 2) If I use ls -l | more; it will show the Chinese character correctly

That is because more does not worry about what non-printing characters can
do to a terminal, but just blindly prints them; fortunately, your terminal
displays them sanely.
> 
> 4) So it appears that the ls command has some kind of weakness that did
> not handle the display of foreign character correctly.

No, it is other programs that have a weakness in that they will blindly
print non-printing characters to a terminal, even if doing so will corrupt
the terminal display.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             [EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGOBDY84KuGfSFAYARAjdoAJ9nhortc90eg9SEPoB8MAvXyaZjbgCfcr4J
kQvURn2KOX2X3EM1Ev7oxPQ=
=HzyB
-----END PGP SIGNATURE-----


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to