diff options
author | Simon Cozens <simon@netthink.co.uk> | 2000-12-08 13:33:31 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-12-08 15:57:11 +0000 |
commit | ed646e6e695bd0d512934a33fa4b7fabef9ff020 (patch) | |
tree | 8ee2d1fe4f8e900d91d931d3a2b7579cdc70e744 /doop.c | |
parent | fac3506f11803acc27862962d9412fc8535bd7b6 (diff) | |
download | perl-ed646e6e695bd0d512934a33fa4b7fabef9ff020.tar.gz |
Re: ebcdic <-> ascii tables interjected in uv <-> utf8 considered harmful
Message-ID: <20001208133331.A11535@deep-dark-truthful-mirror.perlhacker.org>
(The pp_hot part needed a rewrite.)
p4raw-id: //depot/perl@8039
Diffstat (limited to 'doop.c')
-rw-r--r-- | doop.c | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -79,10 +79,7 @@ S_do_trans_simple(pTHX_ SV *sv) c = utf8_to_uv(s, send - s, &ulen, 0); if (c < 0x100 && (ch = tbl[(short)c]) >= 0) { matches++; - if (ch < 0x80) - *d++ = ch; - else - d = uv_to_utf8(d,ch); + d = uv_to_utf8(d,ch); s += ulen; } else { /* No match -> copy */ @@ -192,12 +189,9 @@ S_do_trans_complex(pTHX_ SV *sv)/* SPC - NOT OK */ matches--; } - if (ch >= 0) { - if (hasutf) - d = uv_to_utf8(d, ch); - else - *d++ = ch; - } + if (ch >= 0) + d = uv_to_utf8(d, ch); + matches++; s += hasutf && *s & 0x80 ? UNISKIP(*s) : 1; |