STATIC void
S_tokereport(pTHX_ char *thing, char* s, I32 rv)
-{
+{
SV *report;
DEBUG_T({
report = newSVpv(thing, 0);
STRLEN skip;
UV n;
if (utf)
- n = utf8_to_uv((U8*)start, len, &skip, 0);
+ n = utf8n_to_uvchr((U8*)start, len, &skip, 0);
else {
n = *(U8*)start;
skip = 1;
char *e = d++;
while (e-- > c)
*(e + 1) = *e;
- *c = 0xff;
+ *c = (char)0xff;
/* mark the range as done, and continue */
dorange = FALSE;
didrange = TRUE;
if (hicount) {
char *old_pvx = SvPVX(sv);
char *src, *dst;
-
+
d = SvGROW(sv,
SvLEN(sv) + hicount + 1) +
(d - old_pvx);
}
if (has_utf8 || uv > 255) {
- d = (char*)uv_to_utf8((U8*)d, uv);
+ d = (char*)uvchr_to_utf8((U8*)d, uv);
has_utf8 = TRUE;
if (PL_lex_inwhat == OP_TRANS &&
PL_sublex_info.sub_op) {
/* \N{latin small letter a} is a named character */
case 'N':
- s++;
+ ++s;
if (*s == '{') {
char* e = strchr(s, '}');
SV *res;
e = s - 1;
goto cont_scan;
}
- if (s[1] == 'U' && s[2] == '+') { /* \N{U+HHHH} */
- STRLEN alen = e - s - 3;
- STRLEN blen;
- UV uv = (UV)scan_hex(s + 3, alen, &blen);
-
- if (blen == alen) {
- res = newSVpvn(s, (uv >> 8) + 1); /* filler */
- str = (char *)uv_to_utf8((U8*)SvPVX(res), uv);
- SvCUR_set(res, str - SvPVX(res));
- *str = '\0';
- if (uv > 0x7f)
- SvUTF8_on(res);
- }
- else {
- yyerror("Illegal hexadecimal code on \\N{U+...}");
- e = s - 1;
- goto cont_scan;
- }
- }
- else {
- res = newSVpvn(s + 1, e - s - 1);
- res = new_constant( Nullch, 0, "charnames",
- res, Nullsv, "\\N{...}" );
- }
+ res = newSVpvn(s + 1, e - s - 1);
+ res = new_constant( Nullch, 0, "charnames",
+ res, Nullsv, "\\N{...}" );
if (has_utf8)
sv_utf8_upgrade(res);
str = SvPV(res,len);
STRLEN len = (STRLEN) -1;
UV uv;
if (this_utf8) {
- uv = utf8_to_uv((U8*)s, send - s, &len, 0);
+ uv = utf8n_to_uvchr((U8*)s, send - s, &len, 0);
}
if (len == (STRLEN)-1) {
/* Illegal UTF8 (a high-bit byte), make it valid. */
char *old_pvx = SvPVX(sv);
/* need space for one extra char (NOTE: SvCUR() not set here) */
d = SvGROW(sv, SvLEN(sv) + 1) + (d - old_pvx);
- d = (char*)uv_to_utf8((U8*)d, (U8)*s++);
+ d = (char*)uvchr_to_utf8((U8*)d, (U8)*s++);
}
else {
while (len--)
"Integer overflow in decimal number");
}
}
- tmpend = uv_to_utf8(tmpbuf, rev);
+ /* Append native character for the rev point */
+ tmpend = uvchr_to_utf8(tmpbuf, rev);
if (rev > revmax)
revmax = rev;
sv_catpvn(sv, (const char*)tmpbuf, tmpend - tmpbuf);
SvPOK_on(sv);
SvREADONLY_on(sv);
- if (revmax > 127) {
- SvUTF8_on(sv);
+ /* if (revmax > 127) { */
+ SvUTF8_on(sv); /*
if (revmax < 256)
sv_utf8_downgrade(sv, TRUE);
- }
+ } */
}
}
break;