Subject: | behaviour of decode_utf8 does not match documentation |
The decode_utf8 function is documented as
"equivalent to $string = decode("utf8", $octets [, CHECK])"
However, if CHECK is not passed/true, it is in fact equivalent to utf8::decode($copy). (where $copy is a copy of $octets).
The main difference here is the behaviour on failure - if $octets is not a valid utf8 encoding, decode("utf8", $octets) will return a string containing question marks, wheras decode_utf8($octets) returns undef.
Either the docs should match reality or (better) decode_utf8 should just pass straight through to decode("utf8",..). I'd offer a patch, but this seems trivial.
tom