summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2021-06-30 13:45:12 -0600
committerKarl Williamson <khw@cpan.org>2021-08-14 06:47:43 -0600
commitd4bf6b07402c770d61a5f8692f24fe944655d99f (patch)
tree3f3bfdf3f054385543622303c3dde9873688e3f8 /utf8.c
parent8c87dbc398d8be8921f2a003819c770a791d3432 (diff)
downloadperl-d4bf6b07402c770d61a5f8692f24fe944655d99f.tar.gz
utf8.c: Rmv an EBCDIC dependency
This is now generated by regcharclass.pl
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/utf8.c b/utf8.c
index 12568591a4..6df64810d5 100644
--- a/utf8.c
+++ b/utf8.c
@@ -863,13 +863,9 @@ Perl_is_utf8_char_helper(const U8 * const s, const U8 * e, const U32 flags)
# define FIRST_START_BYTE_THAT_IS_DEFINITELY_SUPER 0xFA
# define IS_UTF8_2_BYTE_SUPER(s0, s1) ((s0) == 0xF9 && (s1) >= 0xA2)
-# define IS_UTF8_2_BYTE_SURROGATE(s0, s1) ((s0) == 0xF1 \
- /* B6 and B7 */ \
- && ((s1) & 0xFE ) == 0xB6)
#else
# define FIRST_START_BYTE_THAT_IS_DEFINITELY_SUPER 0xF5
# define IS_UTF8_2_BYTE_SUPER(s0, s1) ((s0) == 0xF4 && (s1) >= 0x90)
-# define IS_UTF8_2_BYTE_SURROGATE(s0, s1) ((s0) == 0xED && (s1) >= 0xA0)
#endif
if ( (flags & UTF8_DISALLOW_SUPER)
@@ -894,7 +890,7 @@ Perl_is_utf8_char_helper(const U8 * const s, const U8 * e, const U32 flags)
}
if ( (flags & UTF8_DISALLOW_SURROGATE)
- && UNLIKELY(IS_UTF8_2_BYTE_SURROGATE(s0, s1)))
+ && UNLIKELY(is_SURROGATE_utf8(s)))
{
return 0; /* Surrogate */
}
@@ -1748,10 +1744,7 @@ Perl__utf8n_to_uvchr_msgs_helper(const U8 *s,
{
possible_problems |= UTF8_GOT_SUPER;
}
- else if (UNLIKELY(IS_UTF8_2_BYTE_SURROGATE(
- NATIVE_UTF8_TO_I8(*adjusted_s0),
- NATIVE_UTF8_TO_I8(*(adjusted_s0 + 1)))))
- {
+ else if (UNLIKELY(is_SURROGATE_utf8(adjusted_s0))) {
possible_problems |= UTF8_GOT_SURROGATE;
}
}