[luatex] problem with slnunicode's find
patrick at gundla.ch
Tue Mar 2 07:46:40 CET 2010
>> -- NOTE: find positions are in bytes for all ctypes!
> > -- use ascii.sub to cut found ranges!
> Hmm, neither do I want to cut something nor do I have a range available. I just want to count. Attached is my attempt of a utf8 aware find function based on the utf8 aware parts of slnunicode. Comments and improvements are welcome!
What is wrong with
b,e = unicode.utf8.find(str,"%u+")
print("count=" .. tostring(e - b + 1))
More information about the luatex