diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-06-23 12:57:54 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-06-29 22:22:40 -0600 |
commit | bdd8600f35ec7851722b0fe8b4902e0e04ab2800 (patch) | |
tree | 6496d4e8e56d25152a3732a55d811bee1056db73 /utf8.c | |
parent | f74da94c18a7b3cbdb577015ae60665509e912e8 (diff) | |
download | perl-bdd8600f35ec7851722b0fe8b4902e0e04ab2800.tar.gz |
handy.h: Fix isBLANK_uni and isBLANK_utf8
These macros have never worked outside the Latin1 range, so this extends
them to work.
There are no tests I could find for things in handy.h, except that many
of them are called all over the place during the normal course of
events. This commit adds a new file for such testing, containing for
now only with a few tests for the isBLANK's
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -1510,6 +1510,14 @@ Perl_is_uni_ascii(pTHX_ UV c) } bool +Perl_is_uni_blank(pTHX_ UV c) +{ + U8 tmpbuf[UTF8_MAXBYTES+1]; + uvchr_to_utf8(tmpbuf, c); + return is_utf8_blank(tmpbuf); +} + +bool Perl_is_uni_space(pTHX_ UV c) { U8 tmpbuf[UTF8_MAXBYTES+1]; @@ -1830,6 +1838,12 @@ Perl_is_uni_ascii_lc(pTHX_ UV c) } bool +Perl_is_uni_blank_lc(pTHX_ UV c) +{ + return is_uni_blank(c); /* XXX no locale support yet */ +} + +bool Perl_is_uni_space_lc(pTHX_ UV c) { return is_uni_space(c); /* XXX no locale support yet */ @@ -2036,6 +2050,16 @@ Perl_is_utf8_ascii(pTHX_ const U8 *p) } bool +Perl_is_utf8_blank(pTHX_ const U8 *p) +{ + dVAR; + + PERL_ARGS_ASSERT_IS_UTF8_BLANK; + + return is_utf8_common(p, &PL_utf8_blank, "XPosixBlank"); +} + +bool Perl_is_utf8_space(pTHX_ const U8 *p) { dVAR; |