sunja has asked for the wisdom of the Perl Monks concerning the following question:
Hi all, I'm having a small problem getting an xml file properly fetched from the web. I believe it has to do with the fact that the charset isn't stated in the document, but not sure. It looks like perl is getting the file in non-ascii mode.
Or as a sub in my scriptperl -MLWP::Simple -e "getprint 'http://atys.ryzom.com/api/character.p +hp?key=FR521366R0REA16F998&part=items'"
use LWP::Simple; my ($html, @found, $line); my $url = 'http://atys.ryzom.com/api/character.php?key=FR521366R0REA16 +F998&part=items'; $html = get("$url"); unless (length($html)) { warn "Unable to load page for '$url'\n"; } my $headers = HTTP::Headers->new( "Content-type" => "text/xml", "charset" => "UTF-8"); print $headers->as_string() . "\n"; #print '<?xml version="1.0" encoding="utf-8"?>'; print $html;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: problem web xml file
by sunja (Initiate) on Jul 01, 2012 at 22:15 UTC | |
by ig (Vicar) on Jul 02, 2012 at 05:51 UTC | |
|
Re: problem web xml file
by dasgar (Priest) on Jul 01, 2012 at 20:56 UTC | |
by Anonymous Monk on Jul 01, 2012 at 21:11 UTC | |
by sunja (Initiate) on Jul 01, 2012 at 21:31 UTC | |
by Anonymous Monk on Jul 01, 2012 at 21:38 UTC | |
by tobyink (Canon) on Jul 02, 2012 at 13:57 UTC | |
by Anonymous Monk on Jul 03, 2012 at 08:01 UTC | |
by Anonymous Monk on Jul 01, 2012 at 21:39 UTC | |
|
Re: problem web xml file
by Anonymous Monk on Jul 01, 2012 at 21:03 UTC |