http://www.perlmonks.org?node_id=996965


in reply to Login to Java site with WWW::Scripter charset issue

http://search.cpan.org/grep?cpanid=SPROUT&release=WWW-Scripter-0.029&string=charset&i=1&n=1&C=3 and http://search.cpan.org/grep?cpanid=SPROUT&release=WWW-Scripter-0.029&string=Content.Type&i=1&n=1&C=3

suggest the problem is with the website, either the html or the javascript is setting the charset erroneously, and scripter obliges

So, since Scripter is a LWP subclass, you might see http://search.cpan.org/perldoc/LWP::UserAgent#Handlers and http://search.cpan.org/perldoc/HTTP::Config#Matching like

my $umf = URI->new( $urlLogin ); $scripter->add_handler( request_prepare => sub { my($request, $ua, $h) = @_ ->content_type_charset return; }, m_scheme => $umf->scheme, # only call this handler m_host => $umf->host, # for this host ... );

Replies are listed 'Best First'.
Re^2: Login to Java site with WWW::Scripter charset issue
by Anonymous Monk on Oct 03, 2012 at 09:04 UTC

    Whoops, unfinished though there :)

    my($type, $charset) = $h->content_type_charset; $h->content_type( $type ); # ditch charset