sub safe_decode_utf8 ($) {
my $octets = shift;
- # call decode_utf8 on >= 5.20 only if it's not already decoded,
- # otherwise it balks, on < 5.20, always call it
- if ($] < 5.02 || !Encode::is_utf8($octets)) {
+ # call decode_utf8 on Encode.pm >= 2.53 only if it's not already decoded,
+ # otherwise it balks, on < 2.53, always call it
+ if ($Encode::VERSION < 2.53 || !Encode::is_utf8($octets)) {
return decode_utf8($octets);
}
else {