File should not use isprint ...
Mike Frysinger
vapier at gentoo.org
Tue Nov 29 17:36:26 EET 2005
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 ...
-mike
More information about the File
mailing list