This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In installperl, record the state of options in %opts instead of lexicals.
[perl5.git] / pad.c
diff --git a/pad.c b/pad.c
index 18440ee..15b2656 100644 (file)
--- a/pad.c
+++ b/pad.c
@@ -2150,8 +2150,11 @@ S_cv_clone(pTHX_ CV *proto, CV *cv, CV *outside)
     CvSTART(cv)                = CvSTART(proto);
     CvOUTSIDE_SEQ(cv) = CvOUTSIDE_SEQ(proto);
 
-    if (SvPOK(proto))
+    if (SvPOK(proto)) {
        sv_setpvn(MUTABLE_SV(cv), SvPVX_const(proto), SvCUR(proto));
+        if (SvUTF8(proto))
+           SvUTF8_on(MUTABLE_SV(cv));
+    }
     if (SvMAGIC(proto))
        mg_copy((SV *)proto, (SV *)cv, 0, 0);