diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-06-26 14:37:12 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-06-26 14:37:12 +0000 |
commit | 8514a05ad77d06390899752b405c952ef7bae9d5 (patch) | |
tree | 90c2ca0dd41fc7f3bb7770e59195b283437696a5 /pp_hot.c | |
parent | 88b3723725fe20e495cd1ae8cc660366808a32f4 (diff) | |
download | perl-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.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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; |