diff options
author | Karl Williamson <public@khwilliamson.com> | 2013-02-24 16:43:59 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2013-08-29 09:55:56 -0600 |
commit | c80e42f3bedc86f49112644858de416b7d06c09a (patch) | |
tree | 0111a70b6c07fdde8d9094fa5ca27f4efe0d003f /op.c | |
parent | e66b99e978ba46660c4591770f7c1998ea490c2d (diff) | |
download | perl-c80e42f3bedc86f49112644858de416b7d06c09a.tar.gz |
Convert some uvuni() to uvchr()
All the tables are now based on the native character set, so using
uvuni() in almost all cases is wrong.
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -4129,11 +4129,11 @@ S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl) i = 0; transv = newSVpvs(""); while (t < tend) { - cp[2*i] = utf8n_to_uvuni(t, tend-t, &ulen, flags); + cp[2*i] = utf8n_to_uvchr(t, tend-t, &ulen, flags); t += ulen; if (t < tend && *t == ILLEGAL_UTF8_BYTE) { t++; - cp[2*i+1] = utf8n_to_uvuni(t, tend-t, &ulen, flags); + cp[2*i+1] = utf8n_to_uvchr(t, tend-t, &ulen, flags); t += ulen; } else { @@ -4146,11 +4146,11 @@ S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl) UV val = cp[2*j]; diff = val - nextmin; if (diff > 0) { - t = uvuni_to_utf8(tmpbuf,nextmin); + t = uvchr_to_utf8(tmpbuf,nextmin); sv_catpvn(transv, (char*)tmpbuf, t - tmpbuf); if (diff > 1) { U8 range_mark = ILLEGAL_UTF8_BYTE; - t = uvuni_to_utf8(tmpbuf, val - 1); + t = uvchr_to_utf8(tmpbuf, val - 1); sv_catpvn(transv, (char *)&range_mark, 1); sv_catpvn(transv, (char*)tmpbuf, t - tmpbuf); } @@ -4159,13 +4159,13 @@ S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl) if (val >= nextmin) nextmin = val + 1; } - t = uvuni_to_utf8(tmpbuf,nextmin); + t = uvchr_to_utf8(tmpbuf,nextmin); sv_catpvn(transv, (char*)tmpbuf, t - tmpbuf); { U8 range_mark = ILLEGAL_UTF8_BYTE; sv_catpvn(transv, (char *)&range_mark, 1); } - t = uvuni_to_utf8(tmpbuf, 0x7fffffff); + t = uvchr_to_utf8(tmpbuf, 0x7fffffff); sv_catpvn(transv, (char*)tmpbuf, t - tmpbuf); t = (const U8*)SvPVX_const(transv); tlen = SvCUR(transv); @@ -4186,11 +4186,11 @@ S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl) while (t < tend || tfirst <= tlast) { /* see if we need more "t" chars */ if (tfirst > tlast) { - tfirst = (I32)utf8n_to_uvuni(t, tend - t, &ulen, flags); + tfirst = (I32)utf8n_to_uvchr(t, tend - t, &ulen, flags); t += ulen; if (t < tend && *t == ILLEGAL_UTF8_BYTE) { /* illegal utf8 val indicates range */ t++; - tlast = (I32)utf8n_to_uvuni(t, tend - t, &ulen, flags); + tlast = (I32)utf8n_to_uvchr(t, tend - t, &ulen, flags); t += ulen; } else @@ -4200,11 +4200,11 @@ S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl) /* now see if we need more "r" chars */ if (rfirst > rlast) { if (r < rend) { - rfirst = (I32)utf8n_to_uvuni(r, rend - r, &ulen, flags); + rfirst = (I32)utf8n_to_uvchr(r, rend - r, &ulen, flags); r += ulen; if (r < rend && *r == ILLEGAL_UTF8_BYTE) { /* illegal utf8 val indicates range */ r++; - rlast = (I32)utf8n_to_uvuni(r, rend - r, &ulen, flags); + rlast = (I32)utf8n_to_uvchr(r, rend - r, &ulen, flags); r += ulen; } else |