How can I access the UTF-8 Lua library in Neovim?

Neovim embeds LuaJIT, which is PUC Lua 5.1 plus some additions (and it falls back to Lua 5.1 on platforms that LuaJIT is not available).

And Lua 5.1 does not include the utf8 module; that’s a later addition. (To forestall questions: Lua versions are not “upgrades” like Python (minor) versions; they represent different languages for embedding.)

That being said, there’s utf8 luarock that you can install with GitHub - wbthomason/packer.nvim: A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config and then use from within neovim.

1 Like