Skip to content

Fix utf8.len #5431

@d-enk

Description

@d-enk

:return: the number of characters in the string, or between start and end
:rtype: number

Nothing about error

#: ../../doc/reference/reference_lua/utf8.rst:244
msgid "If the string contains a byte sequence which is not valid in UTF-8, each byte in the invalid byte sequence will be counted as one character."
msgstr ""

That's not so

tarantool> utf8.len("123\xf0\xf0")
---
- null
- 4
...

Lua5.3 doc

Returns the number of UTF-8 characters in string s that start between positions i and j (both inclusive). The default for i is 1 and for j is -1. If it finds any invalid byte sequence, returns a false value plus the position of the first invalid byte.

Metadata

Metadata

Assignees

No one assigned

    Labels

    typo[nature] Just a typo. Typically tickets created by online bug reporter.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions