mirror of
https://github.com/love2d/love.git
synced 2026-08-12 16:40:57 +02:00
e82d1dfe54
The module must be required before use, i.e. utf8 = require("utf8"). API documentation can be found here: http://www.lua.org/manual/5.3/manual.html#6.5
Removing the last unicode character in a string (for proper backspace support in text boxes, for example) can be done using utf8.offset, e.g. text = text:sub(1, utf8.offset(text, -1) - 1).