=begin pod :tag<perl6>

=TITLE Unicode

=SUBTITLE Unicode Support in Perl 6

Perl 6 has a high level of support of Unicode.

You can access Unicode codepoints by name:
Rakudo supports all Unicode 9.0 names.

    say "\c[PENGUIN]"; # OUTPUT: «🐧␤»
    say "\c[BELL]";    # OUTPUT: «🔔␤» (U+1F514 BELL)

Additionally, all Unicode codepoint names/named seq/emoji sequences are now case-insensitive:
[Starting in 2017.02]

    say "\c[latin capital letter E]"; # OUTPUT: «E␤» (U+0045)

=head1 Name Aliases

By name alias. Name Aliases are used mainly for codepoints without an official
name, for abbreviations, or for corrections (Unicode names never change).
For full list of them see L<here|http://www.unicode.org/Public/UCD/latest/ucd/NameAliases.txt>.

Control codes without any official name:

    say "\c[ALERT]";     # Not visible (U+0007 control code (also accessible as \a))
    say "\c[LINE FEED]"; # Not visible (U+000A same as "\n")

Corrections:

    say "\c[LATIN CAPITAL LETTER GHA]"; # OUTPUT: «Ƣ␤»
    say "Ƣ".uniname; # OUTPUT: «LATIN CAPITAL LETTER OI␤»
    # This one is a spelling mistake that was corrected in a Name Alias:
    say "\c[PRESENTATION FORM FOR VERTICAL RIGHT WHITE LENTICULAR BRACKET]".uniname;
    # OUTPUT: «PRESENTATION FORM FOR VERTICAL RIGHT WHITE LENTICULAR BRAKCET␤»

Abbreviations:

    say "\c[ZWJ]".uniname;  # OUTPUT: «ZERO WIDTH JOINER␤»
    say "\c[NBSP]".uniname; # OUTPUT: «NO-BREAK SPACE␤»

=head1 Named Sequences

You can also use any of the L<Named Sequences|http://www.unicode.org/Public/UCD/latest/ucd/NamedSequences.txt>,
these are not single codepoints, but sequences of them. [Starting in 2017.02]

    say "\c[LATIN CAPITAL LETTER E WITH VERTICAL LINE BELOW AND ACUTE]";      # OUTPUT: «É̩␤»
    say "\c[LATIN CAPITAL LETTER E WITH VERTICAL LINE BELOW AND ACUTE]".ords; # OUTPUT: «(201 809)␤»

=head2 Emoji Sequences

Rakudo has support for Emoji 4.0 (the latest non-draft release) sequences.
For all of them see:
L<Emoji ZWJ Sequences|http://www.unicode.org/Public/emoji/4.0/emoji-zwj-sequences.txt>
and L<Emoji Sequences|http://www.unicode.org/Public/emoji/4.0/emoji-sequences.txt>.
Note that any names with commas should have their commas removed, since Perl 6 uses
commas to separate different codepoints/sequences inside the same C<\c> sequence.

    say "\c[woman gesturing OK]";         # OUTPUT: «🙆‍♀️␤»
    say "\c[family: man woman girl boy]"; # OUTPUT: «👨‍👩‍👧‍👦␤»

=end pod
