summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-01-22 09:25:26 -0700
committerKarl Williamson <khw@cpan.org>2020-01-23 15:46:56 -0700
commitfb2f0a6ac56afb1c2b30b73112442b1eea989f24 (patch)
treecd8b6cf22421ba80e53b41c2ebfb75157af1a305 /utf8.c
parent5b5e2c0384252d394a387f0be3230a29c28339a2 (diff)
downloadperl-fb2f0a6ac56afb1c2b30b73112442b1eea989f24.tar.gz
utf8.c: Use common fcn for error message
There is now a function that generates this error message. This is so that it is always the same from wherever generated.
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/utf8.c b/utf8.c
index a67c987620..471ad0465f 100644
--- a/utf8.c
+++ b/utf8.c
@@ -37,11 +37,6 @@ static const char malformed_text[] = "Malformed UTF-8 character";
static const char unees[] =
"Malformed UTF-8 character (unexpected end of string)";
-/* Be sure to synchronize this message with the similar one in regcomp.c */
-static const char cp_above_legal_max[] =
- "Use of code point 0x%" UVXf " is not allowed; the"
- " permissible max is 0x%" UVXf;
-
/*
=head1 Unicode Support
These are various utility functions for manipulating UTF8-encoded
@@ -324,7 +319,7 @@ Perl_uvoffuni_to_utf8_flags_msgs(pTHX_ U8 *d, UV uv, const UV flags, HV** msgs)
if (UNLIKELY( uv > MAX_LEGAL_CP
&& ! (flags & UNICODE_ALLOW_ABOVE_IV_MAX)))
{
- Perl_croak(aTHX_ cp_above_legal_max, uv, MAX_LEGAL_CP);
+ Perl_croak(aTHX_ "%s", form_cp_too_large_msg(16, NULL, 0, uv));
}
if ( (flags & UNICODE_WARN_SUPER)
|| ( (flags & UNICODE_WARN_PERL_EXTENDED)
@@ -3324,8 +3319,7 @@ S__to_utf8_case(pTHX_ const UV uv1, const U8 *p,
if (UNLIKELY(UNICODE_IS_SUPER(uv1))) {
if (UNLIKELY(uv1 > MAX_LEGAL_CP)) {
- Perl_croak(aTHX_ cp_above_legal_max, uv1,
- MAX_LEGAL_CP);
+ Perl_croak(aTHX_ "%s", form_cp_too_large_msg(16, NULL, 0, uv1));
}
if (ckWARN_d(WARN_NON_UNICODE)) {
const char* desc = (PL_op) ? OP_DESC(PL_op) : normal;