summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-03-10 11:55:43 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-03-10 11:55:43 +0000
commit9041c2e396c8c7de7680a2007dc341a9f65be0d0 (patch)
tree19075254fbc0495a697b5e15ca1f19a99e02ac77 /sv.c
parent2ef28da1578e18cf36b9a30b71ac471521d2b507 (diff)
downloadperl-9041c2e396c8c7de7680a2007dc341a9f65be0d0.tar.gz
EBCDIC sanity - phase I
- rename utf8/uv functions to indicate what sort of uv they provide (uvuni/uvchr) - use utf8n_xxxx (c.f. pvn) for forms which take length. - back out vN.N and $^V exceptions to e2a/a2e - make "locale" isxxx macros be uvchr (may be redundant?) Not clear yet that toUPPER_uni et. al. return being handled correctly. The tr// and rexexp stuff still needs an audit, assumption is they are working in Unicode space. Need to provide v5.6 names for XS modules (decide is uni or chr ?). p4raw-id: //depot/perlio@9096
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sv.c b/sv.c
index 0fff2066e1..fa3b29edfb 100644
--- a/sv.c
+++ b/sv.c
@@ -4705,8 +4705,8 @@ Perl_sv_pos_b2u(pTHX_ register SV *sv, I32* offsetp)
len = 0;
while (s < send) {
STRLEN n;
-
- if (utf8_to_uv(s, UTF8SKIP(s), &n, 0)) {
+ /* We can use low level directly here as we are not looking at the values */
+ if (utf8n_to_uvuni(s, UTF8SKIP(s), &n, 0)) {
s += n;
len++;
}
@@ -7099,7 +7099,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
uv = args ? va_arg(*args, int) : SvIVx(argsv);
if ((uv > 255 || (uv > 127 && SvUTF8(sv))) && !IN_BYTE) {
eptr = (char*)utf8buf;
- elen = uv_to_utf8((U8*)eptr, uv) - utf8buf;
+ elen = uvchr_to_utf8((U8*)eptr, uv) - utf8buf;
is_utf = TRUE;
}
else {
@@ -7183,13 +7183,11 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
if (!veclen)
continue;
if (vec_utf)
- iv = (IV)utf8_to_uv(vecstr, veclen, &ulen, 0);
+ iv = (IV)utf8n_to_uvchr(vecstr, veclen, &ulen, 0);
else {
iv = *vecstr;
ulen = 1;
}
- if (iv <256)
- iv = NATIVE_TO_ASCII(iv); /* v-strings are codepoints */
vecstr += ulen;
veclen -= ulen;
}
@@ -7265,13 +7263,11 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
if (!veclen)
continue;
if (vec_utf)
- uv = utf8_to_uv(vecstr, veclen, &ulen, 0);
+ uv = utf8n_to_uvchr(vecstr, veclen, &ulen, 0);
else {
uv = *vecstr;
ulen = 1;
}
- if (uv <256)
- uv = NATIVE_TO_ASCII(uv); /* v-strings are codepoints */
vecstr += ulen;
veclen -= ulen;
}