[PLUG] getting a file's character set?

Wil Cooley wcooley at nakedape.cc
Wed Jun 25 01:59:40 UTC 2008


On Mon, 2008-06-23 at 16:15 -0700, Rich Shepard wrote:
> On Mon, 23 Jun 2008, Brent Rieck wrote:
> 
> > I can't seem to make it output a character set, I get mime types and type
> > of file but no character sets (ie: windows-1250 or utf-8) - does your file
> > command determine character sets?
> 
>    man file shows no option to reveal the character set used to display the
> file.

Because it's not optional, it's just part of the description:

$ file test
test: ASCII English text
$ vim test (here I add a Unicode character)
$ file test
test: UTF-8 Unicode English text

That said, file(1) doesn't look at the whole file and as Randal said, if
it's not specified as it is in XML, it's just a guess.

My file(1) is the stock with Fedora 9; 4.23 from
http://www.darwinsys.com/file/.

Wil
-- 
Wil Cooley <wcooley at nakedape.cc>
http://nakedape.cc/wiki/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 185 bytes
Desc: This is a digitally signed message part
URL: <http://lists.pdxlinux.org/pipermail/plug/attachments/20080624/9bdd4a07/attachment.asc>


More information about the PLUG mailing list