Closed daurnimator closed 5 years ago
You are right. Until I can straighten this out, the module is available on Github. The function called escapes any control and non-ASCII characters so it's safe to print.
I removed the use of the module not available via LuaRocks.
Note that string.format's %q
does what safestring does in 5.3.
Not quite---the safestring() I wrote will escape non-ASCII characters---that is, above 128. So a string like "\0\4\tone two three\u{0345}" will print as "\000\004\tone two three\205\133". Lua 5.1 (which the CBOR module supports) doesn't handle it the same way (it fails to escape the \4 and the \t characters).
Ah. I didn't realise you wanted to escape > 128.
Lua 5.3 brings the improvement of 5.1 that control characters (such as \4
and \t) are escaped by
%q`
Trying to use the cbormisc module, it fails to load the library due to the
org.conman.table
module not being installed. I can't seem to find it in any of your existing lua rocks?