summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-06-26 14:37:12 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-06-26 14:37:12 +0000
commit8514a05ad77d06390899752b405c952ef7bae9d5 (patch)
tree90c2ca0dd41fc7f3bb7770e59195b283437696a5 /pp_hot.c
parent88b3723725fe20e495cd1ae8cc660366808a32f4 (diff)
downloadperl-8514a05ad77d06390899752b405c952ef7bae9d5.tar.gz
Another Unicode s/// buglet, from SADAHIRO Tomoyuki.
p4raw-id: //depot/perl@17358
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 22c54fcfde..526468df81 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1985,6 +1985,15 @@ PP(pp_subst)
if (dstr) {
c = SvPV(dstr, clen);
doutf8 = DO_UTF8(dstr);
+ /* replacement needing upgrading? */
+ if (DO_UTF8(TARG) && !doutf8) {
+ SV *nsv = newSVpvn(c, clen);
+ if (PL_encoding)
+ sv_recode_to_utf8(nsv, PL_encoding);
+ else
+ sv_utf8_upgrade(nsv);
+ c = SvPV(nsv, clen);
+ }
}
else {
c = Nullch;