[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.3.0-work2: When does utf8.offset work?
- From: Tim Hill <drtimhill@...>
- Date: Fri, 11 Apr 2014 12:28:30 -0700
On Apr 11, 2014, at 11:30 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 2014-04-11 10:10 GMT+02:00 Tim Hill <drtimhill@gmail.com>:
>
>> Which to me hints that perhaps we need utf8.isvalid() as well?
>
> utf8.isvalid = utf8.len
>
> Works because utf8.len returns a true value (number of characters)
> if the string is valid and a false value (nil) if not.
>
I’d missed that .. good point.
—Tim