go ahead... be a heretic | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Oh monks most exalted and wise, a humble novice seeks to benefit from your vast knowledge of all things Perl. I have a text file (UTF8-encoded) containing words, one per line, and I'm interested in finding out, for each word, how many characters are in it that do not appear in the English alphabet. So I whipped up a script to find out:
Alas, it isn't working; length appears to be counting bytes rather than characters! To wit:
I only occasionally use Perl, and I have no idea what I'm doing wrong. Enlighten me, kind monks, I beseech you! My Perl is 5.14.2, BTW (and I cannot easily upgrade). In reply to length() miscounting UTF8 characters? by Anonymous Monk
|
|