Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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

by Juerd (Abbot)
on Feb 26, 2008 at 20:58 UTC ( #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
Node Status?
node history
Node Type: note [id://670396]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (15)
As of 2014-09-16 13:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (24 votes), past polls