lua-users home
lua-l archive

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



On Sep 24, 2004, at 22:03, Luiz Henrique de Figueiredo wrote:

I'm writing a function to quote a string, that is, it takes a string
and returns a string that when printed is acceptable as a lua literal
(and the literal is equal to the passed string).

This is the job of %q in string.format. I think support for
non-printable characters needs to be added to %q.

Ah. I have been way from Lua for too long, for I did once know about %q. Thanks (and to Rici Lake).

I think you're right, support for non-printable characters needs to be added to %q. Because it's not there now. :)

No-one crying out for support for isprint in string.gsub now? I thought not.

Cheers,
 drj