diff options
author | Karl Williamson <public@khwilliamson.com> | 2013-02-26 12:08:50 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2013-08-29 09:55:58 -0600 |
commit | 378516de21aea9be747038c25876881aaf56e166 (patch) | |
tree | c4130c17547e61ec24210b629f60f18895d29396 /mathoms.c | |
parent | a27992ccf5d1a0c50667fb21ba8ca973f50a7508 (diff) | |
download | perl-378516de21aea9be747038c25876881aaf56e166.tar.gz |
utf8.c: Stop using two functions
This is in preparation for deprecating these functions, to force any
code that has been using these functions to change.
Since the Unicode tables are now stored in native order, these
functions should only rarely be needed.
However, the functionality of these is needed, and in actuality, on
ASCII platforms, the native functions are #defined to these. So what
this commit does is rename the functions to something else, and create
wrappers with the old names, so that anyone using them will get the
deprecation when it actually goes into effect: we are waiting for CPAN
files distributed with the core to change before doing the deprecation.
According to cpan.grep.me, this should affect fewer than 10 additional
CPAN distributions.
Diffstat (limited to 'mathoms.c')
-rw-r--r-- | mathoms.c | 47 |
1 files changed, 46 insertions, 1 deletions
@@ -709,7 +709,7 @@ Perl_uvuni_to_utf8(pTHX_ U8 *d, UV uv) { PERL_ARGS_ASSERT_UVUNI_TO_UTF8; - return Perl_uvuni_to_utf8_flags(aTHX_ d, uv, 0); + return Perl_uvoffuni_to_utf8_flags(aTHX_ d, uv, 0); } bool @@ -1227,6 +1227,51 @@ ASCII_TO_NEED(const UV enc, const UV ch) return ch; } +/* +=for apidoc uvuni_to_utf8_flags + +Instead you almost certainly want to use L</uvchr_to_utf8> or +L</uvchr_to_utf8_flags>>. + +This function is a deprecated synonym for L</uvoffuni_to_utf8_flags>, +which itself, while not deprecated, should be used only in isolated +circumstances. These functions were useful for code that wanted to handle +both EBCDIC and ASCII platforms with Unicode properties, but starting in Perl +v5.20, the distinctions between the platforms have mostly been made invisible +to most code, so this function is quite unlikely to be what you want. + +=cut +*/ + +U8 * +Perl_uvuni_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags) +{ + PERL_ARGS_ASSERT_UVUNI_TO_UTF8_FLAGS; + + return uvoffuni_to_utf8_flags(d, uv, flags); +} + +/* +=for apidoc utf8n_to_uvuni + +Instead use L</utf8_to_uvchr_buf>, or rarely, L</utf8n_to_uvchr>. + +This function was usefulfor code that wanted to handle both EBCDIC and +ASCII platforms with Unicode properties, but starting in Perl v5.20, the +distinctions between the platforms have mostly been made invisible to most +code, so this function is quite unlikely to be what you want. +C<L<NATIVE_TO_UNI(utf8_to_uvchr_buf(...))|/utf8_to_uvchr_buf>> instead. + +=cut +*/ + +UV +Perl_utf8n_to_uvuni(pTHX_ const U8 *s, STRLEN curlen, STRLEN *retlen, U32 flags) +{ + PERL_ARGS_ASSERT_UTF8N_TO_UVUNI; + + return utf8n_to_uvoffuni(s, curlen, retlen, flags); +} END_EXTERN_C |