Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>say "नि".codes; # returns 3

How is "नि" 3 codepoints? There is only two: न and ि . Could this be a bug?



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


Seems to be a typo?

    $ perl6 -e 'say "नि".codes'
    2


Hexdumped the html of the webpage, there's only two codepoints here.


Not 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)?


I'm suggesting this string has two Unicode codepoints. I don't know anything about Hindi language or Devanagari script.


They were probably using an outdated version of rakudo, the latest version returns 2 as you would expect.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: