In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/ec0363d9bb05a67dad10a50c9b76b5aba365199a?hp=20f15c4187eac900e8420667a1591aa1a78ab45d>

- Log -----------------------------------------------------------------
commit ec0363d9bb05a67dad10a50c9b76b5aba365199a
Author: Karl Williamson <[email protected]>
Date:   Thu Dec 16 10:38:09 2010 -0700

    test.pl: extend EBCDIC functions to beyond 255
    
    Allow the functions to handle non-latin1 input.  This would only show up
    on EBCDIC platforms.
-----------------------------------------------------------------------

Summary of changes:
 t/test.pl |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/t/test.pl b/t/test.pl
index 5f8eb98..b58013d 100644
--- a/t/test.pl
+++ b/t/test.pl
@@ -1142,16 +1142,21 @@ sub latin1_to_native($) {
 }
 
 sub ord_latin1_to_native {
-    # given an input latin1 code point, return the platform's native
-    # equivalent value
+    # given an input code point, return the platform's native
+    # equivalent value.  Anything above latin1 is itself.
 
-    return ord latin1_to_native(chr $_[0]);
+    my $ord = shift;
+    return $ord if $ord > 255;
+    return ord latin1_to_native(chr $ord);
 }
 
 sub ord_native_to_latin1 {
-    # given an input platform code point, return the latin1 equivalent value
+    # given an input platform code point, return the latin1 equivalent value.
+    # Anything above latin1 is itself.
 
-    return ord native_to_latin1(chr $_[0]);
+    my $ord = shift;
+    return $ord if $ord > 255;
+    return ord native_to_latin1(chr $ord);
 }
 
 1;

--
Perl5 Master Repository

Reply via email to