lua-users home
lua-l archive

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


On Fri, 29 Jan 2021 at 02:25, <samir.tine@luart.org> wrote:
> Iterating through a string in Lua using a for loop with the Length operator doesn't work for UTF8 encoded strings, especialy with characters that exceed ASCII encoding.

this is wrong.  byte-iterating with the byte length operator and the
byte-based substring function works perfectly well no matter what the
contents of the string are.

UTF8 handling, using UTF8 functions works just as well.

mixing them is a recipe for disaster.


-- 
Javier