Re: pure perl replacment for "/usr/bin/file"



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?
.