develooper Front page | perl.perl5.porters | Postings from May 2019

[perl #134142] Adjust macros dealing with UTF-8 to require extraparameter

James E Keenan
May 25, 2019 02:24
[perl #134142] Adjust macros dealing with UTF-8 to require extraparameter
Message ID:
# New Ticket Created by  James E Keenan 
# Please include the string:  [perl #134142]
# in the subject line of all future correspondence about this issue. 
# <URL: >

pod/perldeprecation.pod contains the following entry for perl-5.32:

In XS code, use of various macros dealing with UTF-8.

These macros will require an extra parameter in Perl 5.32:
"isALPHANUMERIC_utf8", "isASCII_utf8", "isBLANK_utf8",
"isCNTRL_utf8", "isDIGIT_utf8", "isIDFIRST_utf8",
"isPSXSPC_utf8", "isSPACE_utf8", "isVERTWS_utf8",
"isWORDCHAR_utf8", "isXDIGIT_utf8",
"isALPHANUMERIC_LC_utf8", "isALPHA_LC_utf8",
"isASCII_LC_utf8", "isBLANK_LC_utf8", "isCNTRL_LC_utf8",
"isDIGIT_LC_utf8", "isGRAPH_LC_utf8", "isIDCONT_LC_utf8",
"isIDFIRST_LC_utf8", "isLOWER_LC_utf8", "isPRINT_LC_utf8",
"isPSXSPC_LC_utf8", "isPUNCT_LC_utf8", "isSPACE_LC_utf8",
"isUPPER_LC_utf8", "isWORDCHAR_LC_utf8",
"isXDIGIT_LC_utf8", "toFOLD_utf8", "toLOWER_utf8",
"toTITLE_utf8", and "toUPPER_utf8".

There is now a macro that corresponds to each one of these,
simply by appending "_safe" to the name. It takes the extra
parameter. For example, "isDIGIT_utf8_safe" corresponds to
"isDIGIT_utf8", but takes the extra parameter, and its use
doesn't generate a deprecation warning. All are documented
in "Character case changing" in perlapi and "Character
classification" in perlapi.

You can change to use these versions at any time, or, if
you can live with the deprecation messages, wait until 5.32
and add the parameter to the existing calls, without
changing the names.

This change was originally scheduled for 5.30, but was

This entry was recorded in the following commit:

commit 5203d63deea0ef134714a48c272a928fbbe64ce1
Author: Karl Williamson <>
Date: Tue Jan 8 21:04:36 2019 -0700

Delay fatalization of deprecation of unsafe UTF-8 macros
from XS

Trying to earlier make this fatal led to some issues in
primarily Tk, which I haven't had a chance to address, and
it's getting to late in the development cycle to do it now.

Make it so. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About