From owner-freebsd-i18n@FreeBSD.ORG Thu Nov 20 17:09:21 2003 Return-Path: Delivered-To: freebsd-i18n@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E17B416A4CE for ; Thu, 20 Nov 2003 17:09:21 -0800 (PST) Received: from smtp02.syd.iprimus.net.au (smtp02.syd.iprimus.net.au [210.50.76.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3025B43FF7 for ; Thu, 20 Nov 2003 17:09:21 -0800 (PST) (envelope-from tim@robbins.dropbear.id.au) Received: from robbins.dropbear.id.au (210.50.217.136) by smtp02.syd.iprimus.net.au (7.0.020) id 3F8F522A00C1BBEB; Fri, 21 Nov 2003 12:09:20 +1100 Received: by robbins.dropbear.id.au (Postfix, from userid 1000) id 69140611E; Fri, 21 Nov 2003 12:13:03 +1100 (EST) Date: Fri, 21 Nov 2003 12:13:03 +1100 From: Tim Robbins To: Alex Deiter Message-ID: <20031121011303.GB67377@wombat.robbins.dropbear.id.au> References: <003001c3af96$c2336850$6701320a@komi.mts.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <003001c3af96$c2336850$6701320a@komi.mts.ru> User-Agent: Mutt/1.4.1i cc: freebsd-i18n@freebsd.org Subject: Re: /bin/ls incorrectly displays names of files on UTF-8 locales X-BeenThere: freebsd-i18n@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD Internationalization Effort List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2003 01:09:22 -0000 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