File should not use isprint ...

Christos Zoulas christos at zoulas.com
Tue Nov 29 19:49:40 EET 2005


On Nov 29,  3:36pm, vapier at gentoo.org (Mike Frysinger) wrote:
-- Subject: Re: File should not use isprint ...

| On Tue, Nov 29, 2005 at 04:29:45PM +0100, Radek Vok?l wrote:
| > On Tue, 2005-11-29 at 10:05 -0500, Christos Zoulas wrote:
| > > On Nov 29,  3:37pm, rvokal at redhat.com (Radek =?ISO-8859-1?Q?Vok=E1l?=) wrote:
| > > | file shouldn't use "isprint()" to check if a character is printable.
| > > 
| > > Well, this solves the problem with UTF, but what about if the file had \n
| > > embedded in it, or other terminal escape sequences? Also what if the string
| > > did not come from a symlink, but from a %s magic? Is it really UTF then?
| >
| > True, so what about using iswctype(), after converting each mb sequence
| > to a wchar_t, instead of using isprint()?
| 
| or define a file_isprint() function that handles wchar details much
| like file_mbswidth() does now ...

That is a great idea :-) Can either of you implement it? My i18n foo is limited.

christos



More information about the File mailing list