4 ms·
>say "नि".codes; # returns 3 How is "नि" 3 codepoints? There is only two: न and ि . Could this be a bug?
by Grue3 11y ago
>say "नि".codes; # returns 3
How is "नि" 3 codepoints? There is only two: न and ि . Could this be a bug?
- kamaal 11y agoNot sure how to interpret this, are you suggesting the hindi नि should be two code points because when translated to English it is 'Ni'(two letters)?
- Grue3 11y agoI'm suggesting this string has two Unicode codepoints. I don't know anything about Hindi language or Devanagari script.
- EdiX 11y agoHexdumped the html of the webpage, there's only two codepoints here.
- hotkeys 11y agoThey were probably using an outdated version of rakudo, the latest version returns 2 as you would expect.
- cursork 11y agoSeems to be a typo? $ perl6 -e 'say "नि".codes' 2
- cygx 11y agoPerl6 agrees that it consists of only 2 codepoints: say "नि".NFC>>.uniname.perl; #=> ("DEVANAGARI LETTER NA", "DEVANAGARI VOWEL SIGN I") Nothing more serious than a typo in the article would be my guess.