Re: pure perl replacment for "/usr/bin/file"
- From: martin@xxxxxxxxxx (Martin Barth)
- Date: Sun, 29 Apr 2007 11:14:10 +0200
Hello,
I want to determine the character encoding of some strings I have.
Something similar to the "file" tool,
http://search.cpan.org/~knok/File-MMagic-1.27/
John
Hi,
I am sorry John, i think that won't help me :-(
File::MMagic works like File::Type ( which says its a improvement of File::MMagic ) and that checks for Mime types, not for encodings.
martin@nietzsche ~/enc % perl -MFile::MMagic -wle '$f = new File::MMagic(); for(@ARGV){ print
$f->checktype_filename($_)}' *
text/plain
text/plain
text/plain
text/plain
application/octet-stream
text/plain
martin@nietzsche ~/enc % ls
cp1252.txt iso-8859-1.txt mac.txt us-ascii.txt utf16.txt utf8.txt
Are there any other suggestions?
.
- References:
- pure perl replacment for "/usr/bin/file"
- From: Martin Barth
- Re: pure perl replacment for "/usr/bin/file"
- From: John W. Krahn
- pure perl replacment for "/usr/bin/file"
- Prev by Date: Re: really bad use of postfix
- Next by Date: creating hash from scalar variable
- Previous by thread: Re: pure perl replacment for "/usr/bin/file"
- Next by thread: Encryption
- Index(es):