Skip to content

Commit

Permalink
_CHECK_AND_OUTPUT_WIDE_LOCALE_UTF8_MSG: Use utf8_to_uv
Browse files Browse the repository at this point in the history
This is the new preferred form
  • Loading branch information
khwilliamson committed Jan 7, 2025
1 parent 7911101 commit c362135
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions perl.h
Original file line number Diff line number Diff line change
Expand Up @@ -7557,13 +7557,11 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect.
# define _CHECK_AND_OUTPUT_WIDE_LOCALE_UTF8_MSG(s, send) \
STMT_START { /* Check if to warn before doing the conversion work */\
if (! IN_UTF8_CTYPE_LOCALE && ckWARN(WARN_LOCALE)) { \
UV cp = utf8_to_uvchr_buf((U8 *) (s), (U8 *) (send), NULL); \
UV cp; \
utf8_to_uv((U8 *) (s), (U8 *) (send), &cp, NULL); \
Perl_warner(aTHX_ packWARN(WARN_LOCALE), \
"Wide character (U+%" UVXf ") in %s", \
(cp == 0) \
? UNICODE_REPLACEMENT \
: (UV) cp, \
OP_DESC(PL_op)); \
cp, OP_DESC(PL_op)); \
} \
} STMT_END

Expand Down

0 comments on commit c362135

Please sign in to comment.