diff options
author | SADAHIRO Tomoyuki <BQW10602@nifty.com> | 2004-02-23 01:09:33 +0900 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2004-02-23 19:15:53 +0000 |
commit | 90f5826e78891b7633d6b153f416059ce7d36f9e (patch) | |
tree | 8a2e8b752e33f9f0850e9aa9d87122acb62ab9a2 /pp_hot.c | |
parent | 33e4b5a9a1796aefffe3aa9613e9ae84909ceb74 (diff) | |
download | perl-90f5826e78891b7633d6b153f416059ce7d36f9e.tar.gz |
Re: [perl #26905] "use bytes" doesn't apply byte semantics to concatenation
Date: Sun, 22 Feb 2004 16:09:33 +0900
Message-Id: <20040222160505.98E5.BQW10602@nifty.com>
Subject: [PATCH] Encode::CN::HZ (was Re: [perl #26905] "use bytes" doesn't apply byte semantics to concatenation)
From: SADAHIRO Tomoyuki <bqw10602@nifty.com>
Date: Sun, 22 Feb 2004 18:41:43 +0900
Message-Id: <20040222182357.6B39.BQW10602@nifty.com>
Plus, add a "_01" to the theoretical version number of Encode::CN::HZ.
p4raw-id: //depot/perl@22363
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -137,7 +137,7 @@ PP(pp_concat) bool lbyte; STRLEN rlen; char* rpv = SvPV(right, rlen); /* mg_get(right) happens here */ - bool rbyte = !SvUTF8(right), rcopied = FALSE; + bool rbyte = !DO_UTF8(right), rcopied = FALSE; if (TARG == right && right != left) { right = sv_2mortal(newSVpvn(rpv, rlen)); @@ -147,7 +147,7 @@ PP(pp_concat) if (TARG != left) { lpv = SvPV(left, llen); /* mg_get(left) may happen here */ - lbyte = !SvUTF8(left); + lbyte = !DO_UTF8(left); sv_setpvn(TARG, lpv, llen); if (!lbyte) SvUTF8_on(TARG); @@ -160,7 +160,9 @@ PP(pp_concat) if (!SvOK(TARG)) sv_setpv(left, ""); lpv = SvPV_nomg(left, llen); - lbyte = !SvUTF8(left); + lbyte = !DO_UTF8(left); + if (IN_BYTES) + SvUTF8_off(TARG); } #if defined(PERL_Y2KWARN) |