Skip to content

Commit 3a1c8f8

Browse files
committed
[unicode-grant] add info on parse-names to unicode page
Also link to the Unicode page from the Language/quoting
1 parent 0b5126a commit 3a1c8f8

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

doc/Language/quoting.pod6

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ character or a list of characters.
195195
dd $s;
196196
# OUTPUT: «Str $s = "I really ♡♥❤💕 Perl 6!"␤»
197197
198-
You can also use unicode names with C<\c[]>.
198+
You can also use C<L«unicode names|language/unicode#Entering_Unicode_Codepoints_and_Codepoint_Sequences»>
199+
, L<named sequences|https://docs.perl6.org/language/unicode#Named_Sequences>
200+
and L<name aliases|language/unicode#Name_Aliases> with C<L«\c[]|language/unicode#Entering_Unicode_Codepoints_and_Codepoint_Sequences»>.
199201
200202
my $s = "Camelia \c[BROKEN HEART] my \c[HEAVY BLACK HEART]!";
201203
dd $s;

doc/Language/unicode.pod6

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,29 @@
44
55
=SUBTITLE Unicode Support in Perl 6
66
7-
Perl 6 has a high level of support of Unicode.
7+
Perl 6 has a high level of support of Unicode. This document aims to be both an
8+
overview as well as describe Unicode features which don't belong in the documentation
9+
for routine's and methods.
10+
11+
=head1 Entering Unicode Codepoints and Codepoint Sequences
812
913
You can access Unicode codepoints by name:
10-
Rakudo supports all Unicode 9.0 names.
14+
Rakudo supports all Unicode 9.0 names. X<|\c[] unicode name>
1115
1216
say "\c[PENGUIN]"; # OUTPUT: «🐧␤»
1317
say "\c[BELL]"; # OUTPUT: «🔔␤» (U+1F514 BELL)
1418
15-
Additionally, all Unicode codepoint names/named seq/emoji sequences are now case-insensitive:
19+
All Unicode codepoint names/named seq/emoji sequences are now case-insensitive:
1620
[Starting in 2017.02]
1721
1822
say "\c[latin capital letter E]"; # OUTPUT: «E␤» (U+0045)
1923
20-
=head1 Entering Unicode Codepoints and Codepoint Sequences
24+
In addition to using C<\c[]> inside interpolated strings, you can also use
25+
the L<parse-names routine|routine/parse-names#(Str)_routine_parse-names>
26+
or the parse-names method.
27+
28+
say "DIGIT ONE".parse-names; # OUTPUT: «1␤»
29+
say parse-names("DIGIT ONE"); # OUTPUT: «1␤»
2130
2231
=head2 Name Aliases
2332

0 commit comments

Comments
 (0)