Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Nov 2003 12:13:03 +1100
From:      Tim Robbins <tjr@freebsd.org>
To:        Alex Deiter <tiamat@komi.mts.ru>
Cc:        freebsd-i18n@freebsd.org
Subject:   Re: /bin/ls incorrectly displays names of files on UTF-8 locales
Message-ID:  <20031121011303.GB67377@wombat.robbins.dropbear.id.au>
In-Reply-To: <003001c3af96$c2336850$6701320a@komi.mts.ru>
References:  <003001c3af96$c2336850$6701320a@komi.mts.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031121011303.GB67377>