<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
# This file is machine-generated by mktables from the Unicode
# database, Version 15.0.0.  Any changes made here will be lost!


# !!!!!!!   INTERNAL PERL USE ONLY   !!!!!!!
# This file is for internal use by core Perl only.  The format and even the
# name or existence of this file are subject to change without notice.  Don't
# use it directly.  Use Unicode::UCD to access the Unicode character data
# base.



package charnames;

# This module contains machine-generated tables and code for the
# algorithmically-determinable Unicode character names.  The following
# routines can be used to translate between name and code point and vice versa

{ # Closure

    # Matches legal code point.  4-6 hex numbers, If there are 6, the first
    # two must be 10; if there are 5, the first must not be a 0.  Written this
    # way to decrease backtracking.  The first regex allows the code point to
    # be at the end of a word, but to work properly, the word shouldn't end
    # with a valid hex character.  The second one won't match a code point at
    # the end of a word, and doesn't have the run-on issue
    my $run_on_code_point_re = qr/(?^aax: (?: 10[0-9A-F]{4} | [1-9A-F][0-9A-F]{4} | [0-9A-F]{4} ) \b)/;
    my $code_point_re = qr/(?^aa:\b(?^aax: (?: 10[0-9A-F]{4} | [1-9A-F][0-9A-F]{4} | [0-9A-F]{4} ) \b))/;

    # In the following hash, the keys are the bases of names which include
    # the code point in the name, like CJK UNIFIED IDEOGRAPH-4E01.  The value
    # of each key is another hash which is used to get the low and high ends
    # for each range of code points that apply to the name.
    my %names_ending_in_code_point = (
'CJK COMPATIBILITY IDEOGRAPH' =&gt; 
{
'high' =&gt; 
[
64109,
64217,
195101,
],
'low' =&gt; 
[
63744,
64112,
194560,
],
},
'CJK UNIFIED IDEOGRAPH' =&gt; 
{
'high' =&gt; 
[
19903,
40959,
173791,
177977,
178205,
183969,
191456,
201546,
205743,
],
'low' =&gt; 
[
13312,
19968,
131072,
173824,
177984,
178208,
183984,
196608,
201552,
],
},
'KHITAN SMALL SCRIPT CHARACTER' =&gt; 
{
'high' =&gt; 
[
101589,
],
'low' =&gt; 
[
101120,
],
},
'NUSHU CHARACTER' =&gt; 
{
'high' =&gt; 
[
111355,
],
'low' =&gt; 
[
110960,
],
},
'TANGUT IDEOGRAPH' =&gt; 
{
'high' =&gt; 
[
100343,
],
'low' =&gt; 
[
94208,
],
},
'TANGUT IDEOGRAPH SUPPLEMENT' =&gt; 
{
'high' =&gt; 
[
101640,
],
'low' =&gt; 
[
101632,
],
},

    );

    # The following hash is a copy of the previous one, except is for loose
    # matching, so each name has blanks and dashes squeezed out
    my %loose_names_ending_in_code_point = (
'CJKCOMPATIBILITYIDEOGRAPH' =&gt; 
{
'high' =&gt; 
[
64109,
64217,
195101,
],
'low' =&gt; 
[
63744,
64112,
194560,
],
},
'CJKUNIFIEDIDEOGRAPH' =&gt; 
{
'high' =&gt; 
[
19903,
40959,
173791,
177977,
178205,
183969,
191456,
201546,
205743,
],
'low' =&gt; 
[
13312,
19968,
131072,
173824,
177984,
178208,
183984,
196608,
201552,
],
},
'KHITANSMALLSCRIPTCHARACTER' =&gt; 
{
'high' =&gt; 
[
101589,
],
'low' =&gt; 
[
101120,
],
},
'NUSHUCHARACTER' =&gt; 
{
'high' =&gt; 
[
111355,
],
'low' =&gt; 
[
110960,
],
},
'TANGUTIDEOGRAPH' =&gt; 
{
'high' =&gt; 
[
100343,
],
'low' =&gt; 
[
94208,
],
},
'TANGUTIDEOGRAPHSUPPLEMENT' =&gt; 
{
'high' =&gt; 
[
101640,
],
'low' =&gt; 
[
101632,
],
},

    );

    # And the following array gives the inverse mapping from code points to
    # names.  Lowest code points are first
    @code_points_ending_in_code_point = (

{
'high' =&gt; 19903,
'legal' =&gt; 
'
 -0123456789ABCDEFGHIJKNOPRU',
'low' =&gt; 13312,
'name' =&gt; 'CJK UNIFIED IDEOGRAPH',
},
{
'high' =&gt; 40959,
'legal' =&gt; 
'
 -0123456789ABCDEFGHIJKNOPRU',
'low' =&gt; 19968,
'name' =&gt; 'CJK UNIFIED IDEOGRAPH',
},
{
'high' =&gt; 64109,
'legal' =&gt; 
'
 -0123456789ABCDEFGHIJKLMOPRTY',
'low' =&gt; 63744,
'name' =&gt; 'CJK COMPATIBILITY IDEOGRAPH',
},
{
'high' =&gt; 64217,
'legal' =&gt; 
'
 -0123456789ABCDEFGHIJKLMOPRTY',
'low' =&gt; 64112,
'name' =&gt; 'CJK COMPATIBILITY IDEOGRAPH',
},
{
'high' =&gt; 100343,
'legal' =&gt; 
'
 -0123456789ABCDEFGHINOPRTU',
'low' =&gt; 94208,
'name' =&gt; 'TANGUT IDEOGRAPH',
},
{
'high' =&gt; 101589,
'legal' =&gt; 
'
 -0123456789ABCDEFHIKLMNPRST',
'low' =&gt; 101120,
'name' =&gt; 'KHITAN SMALL SCRIPT CHARACTER',
},
{
'high' =&gt; 101640,
'legal' =&gt; 
'
 -0123456789ABCDEFGHILMNOPRSTU',
'low' =&gt; 101632,
'name' =&gt; 'TANGUT IDEOGRAPH SUPPLEMENT',
},
{
'high' =&gt; 111355,
'legal' =&gt; 
'
 -0123456789ABCDEFHNRSTU',
'low' =&gt; 110960,
'name' =&gt; 'NUSHU CHARACTER',
},
{
'high' =&gt; 173791,
'legal' =&gt; 
'
 -0123456789ABCDEFGHIJKNOPRU',
'low' =&gt; 131072,
'name' =&gt; 'CJK UNIFIED IDEOGRAPH',
},
{
'high' =&gt; 177977,
'legal' =&gt; 
'
 -0123456789ABCDEFGHIJKNOPRU',
'low' =&gt; 173824,
'name' =&gt; 'CJK UNIFIED IDEOGRAPH',
},
{
'high' =&gt; 178205,
'legal' =&gt; 
'
 -0123456789ABCDEFGHIJKNOPRU',
'low' =&gt; 177984,
'name' =&gt; 'CJK UNIFIED IDEOGRAPH',
},
{
'high' =&gt; 183969,
'legal' =&gt; 
'
 -0123456789ABCDEFGHIJKNOPRU',
'low' =&gt; 178208,
'name' =&gt; 'CJK UNIFIED IDEOGRAPH',
},
{
'high' =&gt; 191456,
'legal' =&gt; 
'
 -0123456789ABCDEFGHIJKNOPRU',
'low' =&gt; 183984,
'name' =&gt; 'CJK UNIFIED IDEOGRAPH',
},
{
'high' =&gt; 195101,
'legal' =&gt; 
'
 -0123456789ABCDEFGHIJKLMOPRTY',
'low' =&gt; 194560,
'name' =&gt; 'CJK COMPATIBILITY IDEOGRAPH',
},
{
'high' =&gt; 201546,
'legal' =&gt; 
'
 -0123456789ABCDEFGHIJKNOPRU',
'low' =&gt; 196608,
'name' =&gt; 'CJK UNIFIED IDEOGRAPH',
},
{
'high' =&gt; 205743,
'legal' =&gt; 
'
 -0123456789ABCDEFGHIJKNOPRU',
'low' =&gt; 201552,
'name' =&gt; 'CJK UNIFIED IDEOGRAPH',
},
,

    );

    # Is exportable, make read-only
    Internals::SvREADONLY(@code_points_ending_in_code_point, 1);

    # Convert from code point to Jamo short name for use in composing Hangul
    # syllable names
    my %Jamo = (
4352 =&gt; 'G',
4353 =&gt; 'GG',
4354 =&gt; 'N',
4355 =&gt; 'D',
4356 =&gt; 'DD',
4357 =&gt; 'R',
4358 =&gt; 'M',
4359 =&gt; 'B',
4360 =&gt; 'BB',
4361 =&gt; 'S',
4362 =&gt; 'SS',
4363 =&gt; '',
4364 =&gt; 'J',
4365 =&gt; 'JJ',
4366 =&gt; 'C',
4367 =&gt; 'K',
4368 =&gt; 'T',
4369 =&gt; 'P',
4370 =&gt; 'H',
4449 =&gt; 'A',
4450 =&gt; 'AE',
4451 =&gt; 'YA',
4452 =&gt; 'YAE',
4453 =&gt; 'EO',
4454 =&gt; 'E',
4455 =&gt; 'YEO',
4456 =&gt; 'YE',
4457 =&gt; 'O',
4458 =&gt; 'WA',
4459 =&gt; 'WAE',
4460 =&gt; 'OE',
4461 =&gt; 'YO',
4462 =&gt; 'U',
4463 =&gt; 'WEO',
4464 =&gt; 'WE',
4465 =&gt; 'WI',
4466 =&gt; 'YU',
4467 =&gt; 'EU',
4468 =&gt; 'YI',
4469 =&gt; 'I',
4520 =&gt; 'G',
4521 =&gt; 'GG',
4522 =&gt; 'GS',
4523 =&gt; 'N',
4524 =&gt; 'NJ',
4525 =&gt; 'NH',
4526 =&gt; 'D',
4527 =&gt; 'L',
4528 =&gt; 'LG',
4529 =&gt; 'LM',
4530 =&gt; 'LB',
4531 =&gt; 'LS',
4532 =&gt; 'LT',
4533 =&gt; 'LP',
4534 =&gt; 'LH',
4535 =&gt; 'M',
4536 =&gt; 'B',
4537 =&gt; 'BS',
4538 =&gt; 'S',
4539 =&gt; 'SS',
4540 =&gt; 'NG',
4541 =&gt; 'J',
4542 =&gt; 'C',
4543 =&gt; 'K',
4544 =&gt; 'T',
4545 =&gt; 'P',
4546 =&gt; 'H',

    );

    # Leading consonant (can be null)
    my %Jamo_L = (
'' =&gt; 11,
'B' =&gt; 7,
'BB' =&gt; 8,
'C' =&gt; 14,
'D' =&gt; 3,
'DD' =&gt; 4,
'G' =&gt; 0,
'GG' =&gt; 1,
'H' =&gt; 18,
'J' =&gt; 12,
'JJ' =&gt; 13,
'K' =&gt; 15,
'M' =&gt; 6,
'N' =&gt; 2,
'P' =&gt; 17,
'R' =&gt; 5,
'S' =&gt; 9,
'SS' =&gt; 10,
'T' =&gt; 16,

    );

    # Vowel
    my %Jamo_V = (
'A' =&gt; 0,
'AE' =&gt; 1,
'E' =&gt; 5,
'EO' =&gt; 4,
'EU' =&gt; 18,
'I' =&gt; 20,
'O' =&gt; 8,
'OE' =&gt; 11,
'U' =&gt; 13,
'WA' =&gt; 9,
'WAE' =&gt; 10,
'WE' =&gt; 15,
'WEO' =&gt; 14,
'WI' =&gt; 16,
'YA' =&gt; 2,
'YAE' =&gt; 3,
'YE' =&gt; 7,
'YEO' =&gt; 6,
'YI' =&gt; 19,
'YO' =&gt; 12,
'YU' =&gt; 17,

    );

    # Optional trailing consonant
    my %Jamo_T = (
'B' =&gt; 17,
'BS' =&gt; 18,
'C' =&gt; 23,
'D' =&gt; 7,
'G' =&gt; 1,
'GG' =&gt; 2,
'GS' =&gt; 3,
'H' =&gt; 27,
'J' =&gt; 22,
'K' =&gt; 24,
'L' =&gt; 8,
'LB' =&gt; 11,
'LG' =&gt; 9,
'LH' =&gt; 15,
'LM' =&gt; 10,
'LP' =&gt; 14,
'LS' =&gt; 12,
'LT' =&gt; 13,
'M' =&gt; 16,
'N' =&gt; 4,
'NG' =&gt; 21,
'NH' =&gt; 6,
'NJ' =&gt; 5,
'P' =&gt; 26,
'S' =&gt; 19,
'SS' =&gt; 20,
'T' =&gt; 25,

    );

    # Computed re that splits up a Hangul name into LVT or LV syllables
    my $syllable_re = qr/(|B|BB|C|D|DD|G|GG|H|J|JJ|K|M|N|P|R|S|SS|T)(A|AE|E|EO|EU|I|O|OE|U|WA|WAE|WE|WEO|WI|YA|YAE|YE|YEO|YI|YO|YU)(B|BS|C|D|G|GG|GS|H|J|K|L|LB|LG|LH|LM|LP|LS|LT|M|N|NG|NH|NJ|P|S|SS|T)?/;

    my $HANGUL_SYLLABLE = "HANGUL SYLLABLE ";
    my $loose_HANGUL_SYLLABLE = "HANGULSYLLABLE";

    # These constants names and values were taken from the Unicode standard,
    # version 5.1, section 3.12.  They are used in conjunction with Hangul
    # syllables
    my $SBase = 0xAC00;
    my $LBase = 0x1100;
    my $VBase = 0x1161;
    my $TBase = 0x11A7;
    my $SCount = 11172;
    my $LCount = 19;
    my $VCount = 21;
    my $TCount = 28;
    my $NCount = $VCount * $TCount;

    sub name_to_code_point_special {
        my ($name, $loose) = @_;

        # Returns undef if not one of the specially handled names; otherwise
        # returns the code point equivalent to the input name
        # $loose is non-zero if to use loose matching, 'name' in that case
        # must be input as upper case with all blanks and dashes squeezed out.

        if ((! $loose &amp;&amp; $name =~ s/$HANGUL_SYLLABLE//)
            || ($loose &amp;&amp; $name =~ s/$loose_HANGUL_SYLLABLE//))
        {
            return if $name !~ qr/^$syllable_re$/;
            my $L = $Jamo_L{$1};
            my $V = $Jamo_V{$2};
            my $T = (defined $3) ? $Jamo_T{$3} : 0;
            return ($L * $VCount + $V) * $TCount + $T + $SBase;
        }

        # Name must end in 'code_point' for this to handle.
        return if (($loose &amp;&amp; $name !~ /^ (.*?) ($run_on_code_point_re) $/x)
                   || (! $loose &amp;&amp; $name !~ /^ (.*) ($code_point_re) $/x));

        my $base = $1;
        my $code_point = CORE::hex $2;
        my $names_ref;

        if ($loose) {
            $names_ref = \%loose_names_ending_in_code_point;
        }
        else {
            return if $base !~ s/-$//;
            $names_ref = \%names_ending_in_code_point;
        }

        # Name must be one of the ones which has the code point in it.
        return if ! $names_ref-&gt;{$base};

        # Look through the list of ranges that apply to this name to see if
        # the code point is in one of them.
        for (my $i = 0; $i &lt; scalar @{$names_ref-&gt;{$base}{'low'}}; $i++) {
            return if $names_ref-&gt;{$base}{'low'}-&gt;[$i] &gt; $code_point;
            next if $names_ref-&gt;{$base}{'high'}-&gt;[$i] &lt; $code_point;

            # Here, the code point is in the range.
            return $code_point;
        }

        # Here, looked like the name had a code point number in it, but
        # did not match one of the valid ones.
        return;
    }

    sub code_point_to_name_special {
        my $code_point = shift;

        # Returns the name of a code point if algorithmically determinable;
        # undef if not

        # If in the Hangul range, calculate the name based on Unicode's
        # algorithm
        if ($code_point &gt;= $SBase &amp;&amp; $code_point &lt;= $SBase + $SCount -1) {
            use integer;
            my $SIndex = $code_point - $SBase;
            my $L = $LBase + $SIndex / $NCount;
            my $V = $VBase + ($SIndex % $NCount) / $TCount;
            my $T = $TBase + $SIndex % $TCount;
            $name = "$HANGUL_SYLLABLE$Jamo{$L}$Jamo{$V}";
            $name .= $Jamo{$T} if $T != $TBase;
            return $name;
        }

        # Look through list of these code points for one in range.
        foreach my $hash (@code_points_ending_in_code_point) {
            return if $code_point &lt; $hash-&gt;{'low'};
            if ($code_point &lt;= $hash-&gt;{'high'}) {
                return sprintf("%s-%04X", $hash-&gt;{'name'}, $code_point);
            }
        }
        return;            # None found
    }
} # End closure

1;
</pre></body></html>