File should not use isprint ...
Christos Zoulas
christos at zoulas.com
Tue Nov 29 17:05:09 EET 2005
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
More information about the File
mailing list