Skip to content

Commit

Permalink
apply patch from RT#96941 to fix new "\C is deprecated in regex" warn…
Browse files Browse the repository at this point in the history
…ing in 5.21.2
  • Loading branch information
karenetheridge committed Jul 12, 2014
1 parent 90e11b8 commit 7e03cdd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
5.21.1)
- remove all remaining uses of "use vars"

Eric Brine:
- fixed new "\C is deprecated in regex" warning in 5.21.2 (RT#96941)


2014-07-01 Karen Etheridge <ether@cpan.org>

Expand Down
9 changes: 8 additions & 1 deletion URI/Escape.pm
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,15 @@ sub uri_unescape {
$str;
}

# XXX FIXME escape_char is buggy as it assigns meaning to the string's storage format.
sub escape_char {
return join '', @URI::Escape::escapes{$_[0] =~ /(\C)/g};
if (utf8::is_utf8($_[0])) {
my $s = $_[0];
utf8::encode($s);
unshift(@_, $s);
}

return join '', @URI::Escape::escapes{$_[0] =~ /(.)/sg};
}

1;

0 comments on commit 7e03cdd

Please sign in to comment.