In perl.git, the branch khw/ebcdic has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/f10c945af3d902f93b141af04a0dadeccc7e26b3?hp=a19f15a9541bb33cc0f606e41abe1e50dd388464>

- Log -----------------------------------------------------------------
commit f10c945af3d902f93b141af04a0dadeccc7e26b3
Author: Karl Williamson <[email protected]>
Date:   Fri Apr 5 13:32:46 2013 -0600

    XXX experiment for index() failures

M       utf8.c

commit 96825d41769b60211b926657b73b2baf50d9befd
Author: Karl Williamson <[email protected]>
Date:   Fri Apr 5 13:27:42 2013 -0600

    t/op/length.t: EBCDIC fixes

M       t/op/length.t
-----------------------------------------------------------------------

Summary of changes:
 t/op/length.t |    2 +-
 utf8.c        |    7 +++++++
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/t/op/length.t b/t/op/length.t
index 4fbd79f..0e4ed04 100644
--- a/t/op/length.t
+++ b/t/op/length.t
@@ -34,7 +34,7 @@ print "ok 3\n";
 }
 
 {
-    my $a = pack("U", 0xFF);
+    my $a = pack("U", ord_latin1_to_native(0xFF));
 
     print "not " unless length($a) == 1;
     print "ok 6\n";
diff --git a/utf8.c b/utf8.c
index c7561b6..6e9fee3 100644
--- a/utf8.c
+++ b/utf8.c
@@ -1347,6 +1347,12 @@ Perl_bytes_from_utf8(pTHX_ const U8 *s, STRLEN *len, 
bool *is_utf8)
     Newx(d, (*len) - count + 1, U8);
     s = start; start = d;
     while (s < send) {
+        STRLEN ulen;
+        *d++ = (U8)utf8_to_uvchr_buf(s, send, &ulen);
+        s += ulen;
+    }
+#if 0
+    while (s < send) {
        U8 c = *s++;
        if (!UTF8_IS_INVARIANT(c)) {
            /* Then it is two-byte encoded */
@@ -1354,6 +1360,7 @@ Perl_bytes_from_utf8(pTHX_ const U8 *s, STRLEN *len, bool 
*is_utf8)
        }
        *d++ = c;
     }
+#endif
     *d = '\0';
     *len = d - start;
     return (U8 *)start;

--
Perl5 Master Repository

Reply via email to