1 package Unicode::Normalize;
9 our $PACKAGE = __PACKAGE__;
15 our @ISA = qw(Exporter DynaLoader);
16 our @EXPORT = qw( NFC NFD NFKC NFKD );
17 our @EXPORT_OK = qw( normalize decompose reorder compose
18 getCanon getCompat getComposite getCombinClass getExclusion);
19 our %EXPORT_TAGS = ( all => [ @EXPORT, @EXPORT_OK ] );
21 bootstrap Unicode::Normalize $VERSION;
23 use constant CANON => 0;
24 use constant COMPAT => 1;
26 sub NFD ($) { reorder(decompose($_[0], CANON)) }
28 sub NFKD ($) { reorder(decompose($_[0], COMPAT)) }
30 sub NFC ($) { compose(reorder(decompose($_[0], CANON))) }
32 sub NFKC ($) { compose(reorder(decompose($_[0], COMPAT))) }
37 $form eq 'D' || $form eq 'NFD' ? NFD ($_[0]) :
38 $form eq 'C' || $form eq 'NFC' ? NFC ($_[0]) :
39 $form eq 'KD' || $form eq 'NFKD' ? NFKD($_[0]) :
40 $form eq 'KC' || $form eq 'NFKC' ? NFKC($_[0]) :
41 croak $PACKAGE."::normalize: invalid form name: $form";