Parsing of undecoded UTF-16 error
am 15.10.2007 08:02:33 von livefreeordie
Hi - I'm using the following construct to parse an HTML page:
use HTTP::Request;
use LWP::UserAgent;
my $req = new HTTP::Request(GET=>$url);
my $ua = new LWP::UserAgent();
my $resp = $ua->request($req);
my $content = $resp->decoded_content();
I'm getting the following error when attempting to access this URL:
Error: Parsing of undecoded UTF-16 at C:/Perl/lib/LWP/Protocol.pm line
116.
URL: http://securities.stanford.edu/1009/RICKEL96/'
When I take a look at the content, each character is separated by a
newline or space.
What is this, and how can I get around it? I've retrieved other pages
successfully.
Jamie
Re: Parsing of undecoded UTF-16 error
am 15.10.2007 09:16:34 von paduille.4061.mumia.w+nospam
On 10/15/2007 01:02 AM, livefreeordie wrote:
> Hi - I'm using the following construct to parse an HTML page:
>
> use HTTP::Request;
> use LWP::UserAgent;
>
> my $req = new HTTP::Request(GET=>$url);
> my $ua = new LWP::UserAgent();
> my $resp = $ua->request($req);
> my $content = $resp->decoded_content();
>
> I'm getting the following error when attempting to access this URL:
>
> Error: Parsing of undecoded UTF-16 at C:/Perl/lib/LWP/Protocol.pm line
> 116.
> URL: http://securities.stanford.edu/1009/RICKEL96/'
>
I don't get this with LWP::UserAgent 2.033 and HTTP::Request 1.40.
> When I take a look at the content, each character is separated by a
> newline or space.
>
The characters are separated by nulls. The file is in UTF16LE format;
however, this is not advertised in the HTTP header.
> What is this, and how can I get around it? I've retrieved other pages
> successfully.
>
> Jamie
>
What version of Perl are you using? What module versions are you using?
Re: Parsing of undecoded UTF-16 error
am 17.10.2007 07:13:45 von livefreeordie
On Oct 15, 3:16 am, "Mumia W."
+nos...@earthlink.net> wrote:
> On 10/15/2007 01:02 AM, livefreeordie wrote:
>
>
>
>
>
> > Hi - I'm using the following construct to parse an HTML page:
>
> > use HTTP::Request;
> > use LWP::UserAgent;
>
> > my $req = new HTTP::Request(GET=>$url);
> > my $ua = new LWP::UserAgent();
> > my $resp = $ua->request($req);
> > my $content = $resp->decoded_content();
>
> > I'm getting the following error when attempting to access this URL:
>
> > Error: Parsing of undecoded UTF-16 at C:/Perl/lib/LWP/Protocol.pm line
> > 116.
> > URL: http://securities.stanford.edu/1009/RICKEL96/'
>
> I don't get this with LWP::UserAgent 2.033 and HTTP::Request 1.40.
>
> > When I take a look at the content, each character is separated by a
> > newline or space.
>
> The characters are separated by nulls. The file is in UTF16LE format;
> however, this is not advertised in the HTTP header.
>
> > What is this, and how can I get around it? I've retrieved other pages
> > successfully.
>
> > Jamie
>
> What version of Perl are you using? What module versions are you using?- Hide quoted text -
>
> - Show quoted text -
ActivePerl v5.8.8 built for MSWin32-x86-multi-thread
LWP::UserAgent version is 2.036
HTTP::Request version is 1.40
Thanks,
Jamie