Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2016-10-23 23:43 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (302 votes). Check out past polls.