summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xt/op/pat.t11
-rw-r--r--utf8.c12
2 files changed, 21 insertions, 2 deletions
diff --git a/t/op/pat.t b/t/op/pat.t
index 1d2e632e6a..9130454dcb 100755
--- a/t/op/pat.t
+++ b/t/op/pat.t
@@ -5,7 +5,7 @@
# that does fit that format, add it to op/re_tests, not here.
$| = 1;
-print "1..586\n";
+print "1..587\n";
BEGIN {
chdir 't' if -d 't';
@@ -1574,3 +1574,12 @@ EOT
print "ok " . $test++ . "\n";
}
}
+
+{
+ # from Robin Houston
+
+ my $x = "\x{12345678}";
+ $x =~ s/(.)/$1/g;
+ print "not " unless ord($x) == 0x12345678 && length($x) == 1;
+ print "ok 587\n";
+}
diff --git a/utf8.c b/utf8.c
index 785047e673..1694c0d5aa 100644
--- a/utf8.c
+++ b/utf8.c
@@ -170,8 +170,13 @@ Perl_is_utf8_char(pTHX_ U8 *s)
if (!UTF8_IS_CONTINUATION(*s))
return 0;
uv = UTF8_ACCUMULATE(uv, *s);
- if (uv < ouv)
+#if 0
+ /* Depending on the compiler the wrap of the value takig pladve
+ * between 5 and 6 bytes of UTF-8 encoding either works or not.
+ * See similar spot in utf8_to_uvuni(). --jhi */
+ if (uv < ouv)
return 0;
+#endif
ouv = uv;
s++;
}
@@ -342,9 +347,14 @@ Perl_utf8n_to_uvuni(pTHX_ U8 *s, STRLEN curlen, STRLEN *retlen, U32 flags)
}
}
else { /* uv < ouv */
+#if 0
+ /* Depending on the compiler the wrap of the value takig pladve
+ * between 5 and 6 bytes of UTF-8 encoding either works or not.
+ * See similar spot in is_utf8_char(). --jhi */
/* This cannot be allowed. */
warning = UTF8_WARN_OVERFLOW;
goto malformed;
+#endif
}
}
s++;