Unicode

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) 

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 here.

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␤» 

Named Sequences

You can also use any of the Named Sequences, 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)␤» 

Emoji Sequences

Rakudo has support for Emoji 4.0 (the latest non-draft release) sequences. For all of them see: Emoji ZWJ Sequences and Emoji Sequences. 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 sequence.

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