Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: CGI.pm: "Malformed UTF-8 character" in apache's error.log

by Juerd (Abbot)
on Feb 26, 2008 at 20:58 UTC ( [id://670396]=note: print w/replies, xml ) Need Help??


in reply to CGI.pm: "Malformed UTF-8 character" in apache's error.log

Because it doesn't look like it will be repaired any time soon... Let's at least warn people.

The -C flag is implemented with the unsafe ":utf8" layer instead of the safe ":encoding(utf8)" layer. Therefore, -CI, -CS, -Ci, -CD, and their numeric equivalents, are potential security risks.

Likewise, -CA is implemented by setting the SvUTF8 flag (like _utf8_on) and should also be avoided.

  • Instead of -CI, use: binmode STDIN, ":encoding(utf8)";
  • Instead of -Ci, use: use open ":encoding(utf8)";
  • Instead of -CA, use: utf8::decode($_) for @ARGV;
  • Instead of -CS, use -COE and: binmode STDIN, ":encoding(utf8)";
  • Instead of -CD, use -Co and: use open ":encoding(utf8)";
(Using the ":utf8" layer is safe for output streams.)
  • Comment on Re: CGI.pm: "Malformed UTF-8 character" in apache's error.log

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2024-04-23 08:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found