diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-06-26 18:25:51 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-06-26 18:25:51 +0000 |
commit | 4a176938c74b8176b4a677d188d6588d5e88332e (patch) | |
tree | f57943180f8cd708f8030dad1f0f09374754800f /pp_hot.c | |
parent | d38487415f5c04a655b8d9a86fe64aa945ae1cba (diff) | |
download | perl-4a176938c74b8176b4a677d188d6588d5e88332e.tar.gz |
Further tweaking on the Unicode s///.
p4raw-id: //depot/perl@17366
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1983,16 +1983,20 @@ PP(pp_subst) /* known replacement string? */ if (dstr) { - c = SvPV(dstr, clen); - doutf8 = DO_UTF8(dstr); /* replacement needing upgrading? */ if (DO_UTF8(TARG) && !doutf8) { - SV *nsv = sv_2mortal(newSVpvn(c, clen)); + SV *nsv = sv_newmortal(); + SvSetSV(nsv, dstr); if (PL_encoding) sv_recode_to_utf8(nsv, PL_encoding); else sv_utf8_upgrade(nsv); c = SvPV(nsv, clen); + doutf8 = TRUE; + } + else { + c = SvPV(dstr, clen); + doutf8 = DO_UTF8(dstr); } } else { |