Hello all,
I upgraded some of my systems to Perl 5.10 and have fought for several hours with a change that boils down to:
# Perl 5.8 perl -Mencoding=utf8 -le 'print ord chr 156' 156 # Perl 5.10 perl -Mencoding=utf8 -le 'print ord chr 156' 65533
I cannot easily remove the 'use encoding "utf8"' from my script as the pragma does "some magic" that prevents encoding-related disasters (double-encoded strings) further down the road.
This change means (I really hope someone will correct me) that I have to maintain my own copy of CGI::Util with "use bytes" inside "sub unescape". The offending statement is:
$todecode =~ s/%(?:([0-9a-fA-F]{2})|u([0-9a-fA-F]{4}))/ defined($1)? chr hex($1) : utf8_chr(hex($2))/ge;
Does anybody know the reason behind this change? Would that be a bug or a bugfix?
Best regards,
Grzegorz Nosek
In reply to "use encoding" behaviour change under Perl 5.10? by gnosek
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |