monome/norns

replace / assess `string.char()` usage

catfact opened this issue · 0 comments

rephrasing #1701 for more direct action, thanks @256k for bringing the problem to light.

in lua 5.3 at any rate, string.char(x, ... ) is i think technically undefined for x > 127; in practice it can produce a single-element non-ascii byte array which can lead to various problems for string rendering and transmission.

i think either string.char() should always have its arguments clamped to [0, 127], or should be replaced by utf8.char() which will always produce a legal C string at least.

a quick search reveals usages of string.char() in textentry and crow lua modules.