Package: file
Version: 4.26-1
Severity: wishlist

file can detect the encoding of plain text files:

$ file iso8859.txt
iso8859.txt: ISO-8859 text

However, it won't do this for e.g. Perl scripts:

$ file iso8859.pl
iso8859.pl:  a /usr/bin/perl script text executable

This is IMO an inconsistent behaviour. I was always wondering why file detected
the encoding reliably in some cases and not at all in others until I noticed
that it only works for text files. With a trick it's possible to detect the
encoding anyway:

$ file -m /dev/null iso8859.pl
iso8859.pl: ISO-8859 text

but this is not intuitive. I found it by looking through the manpage and trying
every option :)

file should either print the encoding of non-text files by default or it should
have a switch to enable that behaviour.


-- System Information:
Debian Release: 5.0.4
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (x86_64)

Kernel: Linux 2.6.26-1-xen-amd64 (SMP w/1 CPU core)
Locale: LANG=de_DE.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages file depends on:
ii  libc6                  2.7-18lenny2      GNU C Library: Shared libraries
ii  libmagic1              4.26-1            File type determination library us
ii  zlib1g                 1:1.2.3.3.dfsg-12 compression library - runtime

file recommends no packages.

file suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to