diff options
author | Karl Williamson <khw@cpan.org> | 2014-05-05 20:43:47 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2014-05-31 11:42:40 -0600 |
commit | 6302f837102d66f532a1c151f7299abbef3a15dd (patch) | |
tree | 242fe154607368b270e65e29f81f8aed4214259c /embed.fnc | |
parent | d9f92374c5f4b19ed46c29c6710922b80429de59 (diff) | |
download | perl-6302f837102d66f532a1c151f7299abbef3a15dd.tar.gz |
Create isUTF8_CHAR() macro and use it
This macro will inline the code to determine if a character is
well-formed UTF-8 for code points below a certain value, falling back to
a slower function for larger ones. On ASCII platforms, it will inline
for well-beyond all legal Unicode code points. On EBCDIC, it currently
does it for code points up to 0x3FFF. This could be increased, but our
porting tests do the regen every time to make sure everything is ok, and
making it larger slows that down. This is worked around on ASCII by
normally commenting out the code that generates this info, but including
in utf8.h a version that did get generated. This is static information
and won't change. (This could be done for EBCDIC too, but I chose not
to at this time as each code page has a different macro generated, and
it gets ugly getting all of them in utf8.h)
Using this macro allowed for simplification of several functions in
utf8.c
Diffstat (limited to 'embed.fnc')
-rw-r--r-- | embed.fnc | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -633,7 +633,7 @@ pR |OP* |invert |NULLOK OP* cmd ApR |I32 |is_lvalue_sub : Used in cop.h XopR |I32 |was_lvalue_sub -iRn |STRLEN |_is_utf8_char_slow|NN const U8 *s|const STRLEN len +iRn |STRLEN |_is_utf8_char_slow|NN const U8 *s|NN const U8 *e ADMpPR |U32 |to_uni_upper_lc|U32 c ADMpPR |U32 |to_uni_title_lc|U32 c ADMpPR |U32 |to_uni_lower_lc|U32 c |