starwing/luautf8

utf8.len(str) == nil

Opened this issue · 0 comments

Many routines are the same as Lua's string module:

  • ...
  • utf8.len

In fact I see the difference when processing invalid utf8 strings:

local a = "\128\129\130"
print(utf8.len(a))
nil    1

This difference can lead to unobvious bugs.

So it must be either documented, or changed to throw error.