lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> > utf8.len('')
> stdin:1: bad argument #1 to 'len' (initial position out of string)

This is a (surprising) bug. Thanks for the report. (How did we not have
a test for that case??)


> > utf8.offset('a', 0, 3)
> stdin:1: bad argument #3 to 'offset' (position out of range)
> [...]
> > utf8.offset('a', 0, 2)
> 2
> 
> I expect start offsets of 2 and 3 would both raise errors.

Position 2 is exaclty *after* the 'a'; it seems useful to allow
that position as valid.


> There is a typo in the manual for utf8.len: 'sufix' should be 'suffix'.

Thanks.

-- Roberto