pure perl replacment for "/usr/bin/file"
- From: barth@xxxxxxxxxx (Martin Barth)
- Date: Fri, 27 Apr 2007 11:16:23 +0200
Hi,
I want to determine the character encoding of some strings I have.
Something similar to the "file" tool, which gives me this information:
cp1252.text: Non-ISO extended-ASCII text
iso-8859-1.text: ISO-8859 text, with no line terminators
macintosh.text: Non-ISO extended-ASCII text
utf16.text: data
utf8.text: UTF-8 Unicode text, with no line terminators
I got the files, well strings, via CGI upload and I want to encode all
to UTF8. Therefore I want to "use encoding..." but first I have to determine
which encoding the uploaded file is.
In addition I do not want to save the content to a File::Temp to run "file" on it.
Is there a solution in pure perl for this problem?
http://search.cpan.org/~cwest/ppt-0.14/bin/file is the best thing I found so far, but it only showes me this:
# ./file *
cp1252.txt: text
iso-8859-1.text: text
macintosh.text: text
utf16.text: data
utf8.text: text
.
- Follow-Ups:
- Re: pure perl replacment for "/usr/bin/file"
- From: John W. Krahn
- Re: pure perl replacment for "/usr/bin/file"
- Prev by Date: Sorting the items in a directory
- Next by Date: Encryption
- Previous by thread: Login page perl/CGI
- Next by thread: Re: pure perl replacment for "/usr/bin/file"
- Index(es):
Relevant Pages
|
|