This commit changes these functions from converting to/from a string to
calling functions which operate on ordinals instead that are in the
utf8:: namespace.
# equivalent value. Anything above latin1 is itself.
my $ord = shift;
# equivalent value. Anything above latin1 is itself.
my $ord = shift;
- return $ord if $ord > 255;
- return ord latin1_to_native(chr $ord);
+ return $ord if ord('^') == 94; # ASCII, Latin1
+ return utf8::unicode_to_native($ord);
}
sub ord_native_to_latin1 {
}
sub ord_native_to_latin1 {
# Anything above latin1 is itself.
my $ord = shift;
# Anything above latin1 is itself.
my $ord = shift;
- return $ord if $ord > 255;
- return ord native_to_latin1(chr $ord);
+ return $ord if ord('^') == 94; # ASCII, Latin1
+ return utf8::native_to_unicode($ord);