# Use the stated preferred URL or figure it out automatically
$url ||= url( -path_info => 1 );
+# Unescape %XX hex codes (from URI::Escape::uri_unescape)
+$url =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
$url =~ s/^included:/http:/ if $ENV{SERVER_PROTOCOL} eq 'INCLUDED';
# NOTE: Since v3.12, it looks as if CGI.pm misbehaves for SSIs and