develooper Front page | perl.libwww | Postings from December 2003

unicode woes

Thread Next
From:
lars nygaard
Date:
December 6, 2003 04:20
Subject:
unicode woes
Message ID:
1070649661.2991.41.camel@localhost.localdomain
Hi everyone,

I'm having trouble getting unicode from apache(2.0.48) and perl (5.8.0)
via LWP(5.76). Here's an illustrative cgi script:
 
print "Content-type: text/plain; charset=utf-8\n\n"; 
print "Det bør gå";

And it prints nicely in Mozilla. However, this program:
 
my $ua = LWP::UserAgent->new;
my $response = $ua->request(GET 'http://localhost/cgi-bin/test.cgi');
my $content = $response->content;
print $content;

prints "Det bør gå".

I'm sure there is some easy way to do this, but the ones I tried led
nowhere.

Regards,
Lars Nygaard


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About