From 4978b1831a24ff36fc8bea075526005cdf40e132 Mon Sep 17 00:00:00 2001 From: Dave Mitchell Date: Fri, 20 Oct 2006 10:06:57 +0000 Subject: [PATCH] zero length $1 took too long to detect utf8-ness p4raw-id: //depot/perl@29059 --- mg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mg.c b/mg.c index b477386..3ab49c0 100644 --- a/mg.c +++ b/mg.c @@ -861,7 +861,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) TAINT_NOT; sv_setpvn(sv, s, i); PL_tainted = oldtainted; - if (RX_MATCH_UTF8(rx) && is_utf8_string((U8*)s, i)) + if (RX_MATCH_UTF8(rx) && (!i || is_utf8_string((U8*)s, i))) SvUTF8_on(sv); else SvUTF8_off(sv); -- 2.7.4