Commit 85f2cb0c authored by Jason Rhinelander's avatar Jason Rhinelander
Browse files

Fixed previous commit for single-char mode

The previous commit removed binary literals, but didn't properly update
the code for literal character mode.
parent 211739ec
......@@ -288,7 +288,7 @@ sub bytes {
sub codepoint {
my $value = shift;
$value =~ /^$arg$/ or die "Cannot compute codepoint of `$value'";
my ($hex, $utf8_code, $decimal, $bin, $chr) = ($1, $2, $3, $4, $5);
my ($hex, $utf8_code, $decimal, $chr) = ($1, $2, $3, $4);
$hex =~ s/^(?:U\+?|0?x)//i if defined $hex;
$decimal =~ s/^[0D]\+//i if defined $decimal;
if (defined $utf8_code) {
......@@ -302,7 +302,7 @@ sub codepoint {
elsif (defined $chr and length($chr) > 1) {
return map ord, split '', $chr;
}
return defined $hex ? hex($hex) : defined $decimal ? 0+$decimal : defined $bin ? oct($bin) : ord $chr
return defined $hex ? hex($hex) : defined $decimal ? 0+$decimal : ord $chr
}
sub usage {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment