lua-users home
lua-l archive

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


No, because a valid UTF-8 sequence can be invalidated multiple bytes in.

On Fri, Feb 23, 2018 at 8:46 AM Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> "u": reads one or more bytes forming one UTF-8 character, and returns
> that character as a string. Returns nil if the file at the current
> position does not start with a valid UTF-8 sequence.

Can this be done without having to unget more than one byte from the stream?

--
--
Ryan | Charles <vandor2012@gmail.com>
Software Developer / System Administrator
https://hashbang.sh