Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^7: Confusing UTF-8 bug in CGI-script

by Anonyrnous Monk (Hermit)
on Feb 01, 2011 at 21:59 UTC ( #885622=note: print w/ replies, xml ) Need Help??


in reply to Re^6: Confusing UTF-8 bug in CGI-script
in thread Confusing UTF-8 bug in CGI-script

I suspect one of two reasons for the differences: ...

Neither of those is the case.

I've verified (by sending the request through a proxy) that the content is sent UTF-8 encoded (i.e. no %-encoding).  And my Encode::decode also behaves normally (i.e. it would die with "Cannot decode string with wide characters").  This is, however, irrelevant, because CGI.pm has code to prevent double-decoding:

sub _decode_utf8 { my ($self, $val) = @_; if (Encode::is_utf8($val)) { return $val; } else { return Encode::decode(utf8 => $val); } }

This sufficiently explains the behavior I observed and reported (for the input side).


Comment on Re^7: Confusing UTF-8 bug in CGI-script
Download Code
Re^8: Confusing UTF-8 bug in CGI-script
by ikegami (Pope) on Feb 02, 2011 at 01:51 UTC

    Well, it's pretty damn close. I said

    Maybe your version of decode

    I should have said

    Maybe your version of the decoder

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://885622]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (14)
As of 2014-07-22 13:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (113 votes), past polls