Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: "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 "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: "Malformed UTF-8 character" in apache's error.log

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://670396]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2018-01-23 23:02 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (254 votes). Check out past polls.