diff options
author | Karl Williamson <khw@cpan.org> | 2021-05-29 14:31:47 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2021-07-31 15:00:38 -0600 |
commit | 6bce142c8b777339676742d282ed0519b3c95aa8 (patch) | |
tree | 456417989a7813182fd5756e85b7f8ef4d0b26bf /regen | |
parent | 67260a96082ff542a79fd0bc3395144c94d5b958 (diff) | |
download | perl-6bce142c8b777339676742d282ed0519b3c95aa8.tar.gz |
regen/charset xlations.pl: Use revised UTF-8 macros
I realized that two base level utf8.h macros for UTF-8 could be
refactored to eliminate the conditionals in each. Those macros have
equivalents in the pure perl code changed by this commit, which I
changed before the utf8.h versions to verify that everything worked, by
verifying there was no difference in the generated tables.
Diffstat (limited to 'regen')
-rw-r--r-- | regen/charset_translations.pl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/regen/charset_translations.pl b/regen/charset_translations.pl index cb7f801b07..218b85e551 100644 --- a/regen/charset_translations.pl +++ b/regen/charset_translations.pl @@ -243,13 +243,13 @@ sub get_I8_2_utf($) { sub _UTF_START_MASK($) { # Internal my $len = shift; - return (($len >= 7) ? 0x00 : (0x1F >> ($len - 2))); + return (0x7F >> ($len)); } sub _UTF_START_MARK($) { # Internal my $len = shift; - return (($len > 7) ? 0xFF : (0xFF & (0xFE << (7- $len)))); + return (0xFF & ~(0xFF >> ($len))); } sub cp_2_utfbytes($$) { |