lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello,

GitHub: https://github.com/aperezdc/lua-wcwidth
LuaRocks: luarocks install wcwidth

The lua-wcwidth module implements the wcwidth(3) function as specified by
the POSIX.1-2001 and POSIX.1-2008 specifications in pure Lua, without any
dependencies.

This function is mostly useful to determine how many “cells” a character
takes, in order to precisely write and position Unicode text content into
a terminal — or into any other output device using monospaced fonts.

This module has been born as a byproduct needed to implement a module for
line-based terminal input [1] Lua which can be integrated with cqueues [2]
for asynchronous operation *and* has proper Unicode support.

Have fun playing with it, though I suspect it will be only useful for code
which needs to do text terminal output :-)

Cheers,

--
 ☛ Adrián

[1] https://github.com/aperezdc/lua-lineinput (beware, WIP code!)
[2] https://luarocks.org/modules/daurnimator/cqueues

Attachment: signature.asc
Description: signature