diff options
author | Andreas König <a.koenig@mind.de> | 2002-04-22 14:08:48 +0200 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-04-24 02:03:08 +0000 |
commit | 89afcb60a8aa0fcded9f2490166a9f2c4cb540f8 (patch) | |
tree | 74d57c1632f7620552793c1b9ef3d677b48e16b0 /pp_hot.c | |
parent | dd2bab0fb2e17ae44696734bb227a5e113986f34 (diff) | |
download | perl-89afcb60a8aa0fcded9f2490166a9f2c4cb540f8.tar.gz |
New UTF-8 surprise
Message-ID: <m38z7gjb9r.fsf@anima.de>
p4raw-id: //depot/perl@16124
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -2117,7 +2117,14 @@ PP(pp_subst) break; } while (CALLREGEXEC(aTHX_ rx, s, strend, orig, s == m, TARG, NULL, r_flags)); - sv_catpvn(dstr, s, strend - s); + if (doutf8 && !DO_UTF8(dstr)) { + SV* nsv = sv_2mortal(newSVpvn(s, strend - s)); + + sv_utf8_upgrade(nsv); + sv_catpvn(dstr, SvPVX(nsv), SvCUR(nsv)); + } + else + sv_catpvn(dstr, s, strend - s); (void)SvOOK_off(TARG); Safefree(SvPVX(TARG)); |