Return to Snippet

Revision: 4734
at January 18, 2008 11:36 by eszpee


Initial Code
use LWP::Simple;

sub getfeedencoding {
#takes: feed url
#returns: feed encoding based on what it says about itself in the XML header
#sample string: encoding="UTF-8"
    my $feedurl = shift;
    my $pagecontent = get($feedurl);
    $pagecontent =~ m{encoding="(.*?)"};
    return $1 or undef;
}

Initial URL


Initial Description


Initial Title
Get the character encoding of a feed

Initial Tags


Initial Language
Perl