


=encoding UTF-8

=head1 NAME

Unicode::Confuse - Identify and replace Unicode confusables

=head1 SYNOPSIS

    use Unicode::Confuse;

=head1 VERSION

This documents version 0.02 of Unicode-Confuse
corresponding to L<git commit 94f8d8c093e8895fcab012e35f47c4d0a6ff2eb5|https://github.com/benkasminbullock/unicode-confuse/commit/94f8d8c093e8895fcab012e35f47c4d0a6ff2eb5> released on Wed Apr 14 16:47:56 2021 +0900.

=head1 DESCRIPTION

Unicode confusables Perl module.

=head1 FUNCTIONS

=head2 canonical

   my $canonical = canonical ($c);

If C<$c> is a confusable, give the canonical form of C<$c>. If not,
returns the undefined value.

=head2 confusable

    if (confusable ($c)) {
        # do something.
    }

Is C<$c> confusable, yes or no? This matches C<$c> against the large
regex in L<Unicode::Confuse::Regex>.

=head1 DEPENDENCIES

=over

=item L<File::Slurper>

This is used by the parsing module L<Unicode::Confuse::Parse>. You
don't actually need to use the parsing module to use this module with
the built-in version of the data.

=item L<JSON::Parse>

This is used to parse the JSON-formatted file of confusables
distributed with the module.

=back 

=head1 BUGS

=over

=item Unicode specifications

This does not even attempt to replicate the Unicode requirements for
software for handling confusables. In other words, this Perl module
makes no claim whatsoever to be "An implementation claiming
conformance to this specification" as described in the text of the
L</Unicode Consortium specification>.

=item Data quality

The data in the Unicode confusables file is of mixed quality, with
nearly identical or indistinguishable characters muddled together with
things which are clearly quite different from one another.

=back

=head1 SEE ALSO

=head2 In this distribution

The script F<make-confusables.pl>, available only in the github
repository, makes the data files for this Perl distribution.

L<Unicode::Confuse::Parse> is used to parse the data file
(F<confusables.txt>). It is used by F<make-confusables.pl>.

L<Unicode::Confuse::Regex> is generated by F<make-confusables.pl>. It
matches all confusables.

The unexported variable C<$Unicode::Confuse::data> contains the
complete confusable data. C<< $data->{confusables} >> contains a map
from confusables to the canonical format, and C<< $data->{reverse} >>
contains a map from the canonical form to an array containing the
corresponding set of confusables, which may have only one member.

=head2 Unicode Consortium information

=over

=item Unicode Consortium specification

See L<http://www.unicode.org/reports/tr39> for the Unicode Consortium
specification.

=item Unicode data files

The following links point to the latest data files:

=over

=item L<The data used by this module|https://www.unicode.org/Public/security/latest/confusables.txt>

=item L<The same data in a different format|https://www.unicode.org/Public/security/latest/confusablesSummary.txt>

=back

=back



=head1 AUTHOR

Ben Bullock, <bkb@cpan.org>

=head1 COPYRIGHT & LICENCE

This package and associated files are copyright (C) 
2021
Ben Bullock.

You can use, copy, modify and redistribute this package and associated
files under the Perl Artistic Licence or the GNU General Public
Licence.



