init.lua 650 B

123456789101112131415161718192021
  1. return {
  2. tag = 'libraries',
  3. summary = 'UTF-8 string processing.',
  4. description = [[
  5. LÖVR includes Lua 5.3's `utf8` library, even on Lua versions that don't support it. Lua's
  6. regular strings aren't utf8-aware, so this library makes it easier to work with multi-byte
  7. characters that are outside the ASCII range.
  8. See the [Lua reference manual](https://www.lua.org/manual/5.3/manual.html#6.5) for
  9. documentation.
  10. ]],
  11. external = true,
  12. example = [[
  13. local utf8 = require 'utf8'
  14. local str = 'LÖVR'
  15. print(string.len(str)) --> prints 5, because Ö takes up 2 bytes
  16. print(utf8.len(str)) --> prints 4
  17. ]]
  18. }