X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=utf8.c;h=0153fd6cd86858228ce7269f52b10395560cc3ef;hb=2decb4fb82e001e3c9671c57b61232c651a9c22c;hp=2090b7cbc5a0b3600952cf1768f48c932eecc90b;hpb=70c6d02e8060a55a75042c794203b8925b3151f3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/utf8.c b/utf8.c index 2090b7c..0153fd6 100644 --- a/utf8.c +++ b/utf8.c @@ -68,8 +68,8 @@ Perl_uv_to_utf8(pTHX_ U8 *d, UV uv) *d++ = (( uv & 0x3f) | 0x80); return d; } -#ifdef Quad_t - if (uv < 0x2000000000) +#ifdef HAS_QUAD + if (uv < 0x1000000000LL) #endif { *d++ = 0xfe; /* Can't match U+FEFF! */ @@ -81,7 +81,7 @@ Perl_uv_to_utf8(pTHX_ U8 *d, UV uv) *d++ = (( uv & 0x3f) | 0x80); return d; } -#ifdef Quad_t +#ifdef HAS_QUAD { *d++ = 0xff; /* Can't match U+FFFE! */ *d++ = (((uv >> 36) & 0x3f) | 0x80); @@ -285,6 +285,14 @@ Perl_is_uni_alpha(pTHX_ U32 c) } bool +Perl_is_uni_ascii(pTHX_ U32 c) +{ + U8 tmpbuf[10]; + uv_to_utf8(tmpbuf, (UV)c); + return is_utf8_ascii(tmpbuf); +} + +bool Perl_is_uni_space(pTHX_ U32 c) { U8 tmpbuf[10]; @@ -341,13 +349,21 @@ Perl_is_uni_print(pTHX_ U32 c) } bool -is_uni_punct(U32 c) +Perl_is_uni_punct(pTHX_ U32 c) { U8 tmpbuf[10]; uv_to_utf8(tmpbuf, (UV)c); return is_utf8_punct(tmpbuf); } +bool +Perl_is_uni_xdigit(pTHX_ U32 c) +{ + U8 tmpbuf[10]; + uv_to_utf8(tmpbuf, (UV)c); + return is_utf8_xdigit(tmpbuf); +} + U32 Perl_to_uni_upper(pTHX_ U32 c) { @@ -399,6 +415,12 @@ Perl_is_uni_alpha_lc(pTHX_ U32 c) } bool +Perl_is_uni_ascii_lc(pTHX_ U32 c) +{ + return is_uni_ascii(c); /* XXX no locale support yet */ +} + +bool Perl_is_uni_space_lc(pTHX_ U32 c) { return is_uni_space(c); /* XXX no locale support yet */ @@ -446,6 +468,12 @@ Perl_is_uni_punct_lc(pTHX_ U32 c) return is_uni_punct(c); /* XXX no locale support yet */ } +bool +Perl_is_uni_xdigit_lc(pTHX_ U32 c) +{ + return is_uni_xdigit(c); /* XXX no locale support yet */ +} + U32 Perl_to_uni_upper_lc(pTHX_ U32 c) {