This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix perl #126186 - (*ACCEPT) does not allow arguments
[perl5.git] / t / charset_tools.pl
index 6abf902..0621a7a 100644 (file)
@@ -8,7 +8,7 @@ $::IS_EBCDIC = ord 'A' == 193;
 # the set of 256 characters which is usually called Latin1.  However, they
 # will work properly with any character input, not just Latin1.
 
-sub native_to_latin1($) {
+sub native_to_uni($) {
     my $string = shift;
 
     return $string if $::IS_ASCII;
@@ -23,13 +23,13 @@ sub native_to_latin1($) {
     return $output;
 }
 
-sub latin1_to_native($) {
+sub uni_to_native($) {
     my $string = shift;
 
     return $string if $::IS_ASCII;
     my $output = "";
     for my $i (0 .. length($string) - 1) {
-        $output .= chr(ord_latin1_to_native(ord(substr($string, $i, 1))));
+        $output .= chr(utf8::unicode_to_native(ord(substr($string, $i, 1))));
     }
     # Preserve utf8ness of input onto the output, even if it didn't need to be
     # utf8