Skip to content

Commit

Permalink
S15-unicode, change .chars to .codes where this was actually intended
Browse files Browse the repository at this point in the history
`.chars` was used be all the examples output's specified the number of
codes. Use `.codes` in the example because of this
  • Loading branch information
samcv committed Jan 8, 2017
1 parent fb4024c commit 660070a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions S15-unicode.pod
Expand Up @@ -57,7 +57,7 @@ Perl 6 by default operates on graphemes, so counting by graphemes involves:
To count by codepoints, conversion of a string to one of NFC, NFD, NFKC, or NFKD
is needed:
"string".NFC.chars
"string".NFC.codes
"string".NFKD.codes
To count by code units, you can convert to the appropriate buffer type.
Expand Down Expand Up @@ -126,11 +126,11 @@ software.
All four of NFC, NFD, NFKC, and NFKD can be considered valid "codepoint views",
though each differ in their exact formulation of the contents of a string:
say "ẛ̣".chars; # OUTPUT: 1 (NFG, ẛ̣)
say "ẛ̣".NFC.chars; # OUTPUT: 2 (NFC, ẛ + ̣)
say "ẛ̣".NFD.chars; # OUTPUT: 3 (NFD, ſ + ̣+ ̇)
say "ẛ̣".NFKC.chars; # OUTPUT: 1 (NFKC, ṩ)
say "ẛ̣".NFKD.chars; # OUTPUT: 3 (NFKD, s + ̣+ ̇)
say "ẛ̣".codes; # OUTPUT: 2 (NFG, ẛ̣)
say "ẛ̣".NFC.codes; # OUTPUT: 2 (NFC, ẛ + ̣)
say "ẛ̣".NFD.codes; # OUTPUT: 3 (NFD, ſ + ̣+ ̇)
say "ẛ̣".NFKC.codes; # OUTPUT: 1 (NFKC, ṩ)
say "ẛ̣".NFKD.codes; # OUTPUT: 3 (NFKD, s + ̣+ ̇)
Those who wish to operate with strings on the codepoint level may wish to use
NFC, as it is the least different from NFG, as well as Perl 6's default form for
Expand Down

0 comments on commit 660070a

Please sign in to comment.