Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the WWW-Mechanize CPAN distribution.

Report information
The Basics
Id: 44533
Status: rejected
Priority: 0/
Queue: WWW-Mechanize

People
Owner: Nobody in particular
Requestors: FANY [...] cpan.org
way [...] ipsite.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.54
Fixed in: 1.34



Subject: Wrong encoding sent at url
When Mechanize send an url it always use UTF-8/utf8 encoding, but many site only spect her own enconding. This issue fail at v1.54 but is correct at v1.34 Here's a discution about this on Perlmonks: http://www.perlmonks.org/? node_id=752170
The following workaround works for me: package my::WWW::Mechanize; use base 'WWW::Mechanize'; use Encode qw(encode); sub update_html { my ( $self, $html ) = @_; $self->SUPER::update_html( encode( $self->response->encoding, $html ) ); } You will also have to submit accordingly encoded values to field methods to prevent automatical utf8 upgrades within URI's ->query_form() method, e.g. my $encoding = $mech->response->encoding; $mech->submit_form( fields => { map encode( $encoding, $_ ), ... } ); Regards, fany
Please repost this ticket at http://code.google.com/p/www-mechanize/issues/list. That is the proper place to post Mech tickets. Thanks.