File should not use isprint ...
Radek Vokál
rvokal at redhat.com
Tue Nov 29 17:29:45 EET 2005
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:
> -- Subject: File should not use isprint ...
>
> | Hi,
> |
> | Using the provided testcase:
> |
> | $ ./file-cannot-handle-utf-1.sh
> | expected result:
> | symbolic link to '/tmp/=C2=A5=C2=B5=C3=85=D0=85=D2=B5=D3=95=E4=B8=A5=E5=BC=
> | =A5=E6=BC=A5'
> |
> | $ file /tmp/sln.test
> | /tmp/sln.test: symbolic link to
> | `/tmp/\302\245\302\265\303\205\320\205\322\265\323\225\344\270\245\345\274\=
> | 245\346\274\245'
> |
> | $ file -r /tmp/sln.test
> | /tmp/sln.test: symbolic link to `/tmp/=C2=A5=C2=B5=C3=85=D0=85=D2=B5=D3=95=
> | =E4=B8=A5=E5=BC=A5=E6=BC=A5'
> |
> | file confuses what it considers to be "non-printable" characters in file_ge=
> | tbuffer() in
> | src/funcs.c.
> |
> | 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?
>
> christos
>
True, so what about using iswctype(), after converting each mb sequence
to a wchar_t, instead of using isprint()?
Radek
--
Radek Vokál <rvokal at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mx.gw.com/pipermail/file/attachments/20051129/f8ff6d5a/attachment.bin
More information about the File
mailing list