0
  0   ˆl–Ðz¾”Jn-jq@5p ¸'ÔÅ£Á„e ¶_‹uÐb&=LV[(ÅÄ ?÷     # !!!!!!!   INTERNAL PERL USE ONLY   !!!!!!!
# This helper module is for internal use by core Perl only.  This module is
# subject to change or removal at any time without notice.  Don't use it
# directly.  Use the public <charnames> module instead.

package _charnames;
use strict;
use warnings;
our $VERSION = '1.48';
use unicore::Name;    # mktables-generated algorithmically-defined names

use bytes ();          # for $bytes::hint_bits
use re "/aa";          # Everything in here should be ASCII

$Carp::Internal{ (__PACKAGE__) } = 1;

# Translate between Unicode character names and their code points.  This is a
# submodule of package <charnames>, used to allow \N{...} to be autoloaded,
# but it was decided not to autoload the various functions in charnames; the
# splitting allows this behavior.
#
# The official names with their code points are stored in a table in
# lib/unicore/Name.pl which is read in as a large string (almost 3/4 Mb in
# Unicode 6.0).  Each code point sequence appears on a line by itself, with
# its corresponding name occupying the next line in the string.  (Some of the
# CJK and the Hangul syllable names are instead determined algorithmically via
# subroutines stored instead in lib/unicore/Name.pm).  Because of the large
# size of this table, it isn't converted into hashes for faster lookup.
#
# But, user defined aliases are stored in their own hashes, as are Perl
# extensions to the official names.  These are checked first before looking at
# the official table.
#
# Basically, the table is grepped for the input code point (viacode()) or
# name (the other functions), and the corresponding value on the next or
# previous line is returned.  The grepping is done by turning the input into a
# regular expression.  Thus, the same table does double duty, used by both
# name and code point lookup.  (If we were to have hashes, we would need two,
# one for each lookup direction.)
#
# For loose name matching, the logical thing would be to have a table
# with all the ignorable characters squeezed out, and then grep it with the
# similiarly-squeezed input name.  (And this is in fact how the lookups are
# done with the small Perl extension hashes.)  But since we need to be able to
# go from code point to official name, the original table would still need to
# exist.  Due to the large size of the table, it was decided to not read
# another very large string into memory for a second table.  Instead, the
# regular expression of the input name is modified to have optional spaces and
# dashes between characters.  For example, in strict matching, the regular
# expression would be:
#   qr/^DIGIT ONE$/m
# Under loose matching, the blank would be squeezed out, and the re would be:
#   qr/^D[- ]?I[- ]?G[- ]?I[- ]?T[- ]?O[- ]?N[- ]?E$/m
# which matches a blank or dash between any characters in the official table.
#
# This is also how script lookup is done.  Basically the re looks like
#   qr/ (?:LATIN|GREEK|CYRILLIC) (?:SMALL )?LETTER $name/
# where $name is the loose or strict regex for the remainder of the name.

# The hashes are stored as utf8 strings.  This makes it easier to deal with
# sequences.  I (khw) also tried making Name.pl utf8, but it slowed things
# down by a factor of 7.  I then tried making Name.pl store the utf8
# equivalents but not calling them utf8.  That led to similar speed as leaving
# it alone, but since that is harder for a human to parse, I left it as-is.

my %system_aliases = (

    'SINGLE-SHIFT 2'                => chr utf8::unicode_to_native(0x8E),
    'SINGLE-SHIFT 3'                => chr utf8::unicode_to_native(0x8F),
    'PRIVATE USE 1'                 => chr utf8::unicode_to_native(0x91),
    'PRIVATE USE 2'                 => chr utf8::unicode_to_native(0x92),
);

# These are the aliases above that differ under :loose and :full matching
# because the :full versions have blanks or hyphens in them.
#my %loose_system_aliases = (
#);

#my %deprecated_aliases;
#$deprecated_aliases{'BELL'} = chr utf8::unicode_to_native(0x07) if