Invalid entry caused Cf to complain that it lacked an init value.
Reimplementing the function in terms of the string library was
quicker than figuring out what was wrong with the lpeg patterns.
Improve output of message error on garbled output.
This could be much simpler with string.format from Lua 5.2,
but for Lua 5.1 we have to do it char by char.