bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A bug -maybe or just some odd feature


From: Eric Blake
Subject: Re: A bug -maybe or just some odd feature
Date: Tue, 01 May 2007 22:17:29 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.5.666

-----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             address@hidden
-----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-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]