Re: /bin/ls incorrectly displays names of files on UTF-8 locales

Tim Robbins <[email protected]>
Newsgroups gmane.os.freebsd.devel.internationalization
Message-ID <[email protected]>
On Thu, Nov 20, 2003 at 09:47:33PM +0300, Alex Deiter wrote:

> /bin/ls incorrectly displays names of files on UTF-8 locales
> (ports/misc/utf8locale):
[...]
> Why ?
> 
> All other programs from /bin and /sbin work correctly.

ls is trying to avoid writing what it thinks are non-printable characters,
to avoid screwing up the terminal by writing control characters etc.
It doesn't understand multibyte characters, though, so the output is
incorrect. (It doesn't understand characters that take up more than
one column on the screen, either.) There's already a PR about this problem,
but I haven't found the time to fix it; it involves scanning the string
with mbtowc() and checking each character with iswprint().

The other programs work correctly because they do not check for non-printable
characters.


Tim
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-i18n
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.