[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: isprint/isgraph not strictly do-able in Lua
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 25 Oct 2010 16:52:48 -0200
> The weasel words of the ISO C standard say:
>
> "the term control character refers to a member of a locale-specific
> set of characters that are not printing characters."
>
> Therefore one cannot, sadly, deduce that string.match(s, "%C") is the
> same as isprint.
>
> (isgraph is the same as isprint, but is not true for the space character).
>
> I plan to add isprint and isgraph to luaposix for this reason (in
> common with some other useful bits of the C standard library that are
> missing from the Lua standard libraries).
'%g' (isgraph) was added to Lua 5.2 (work 4 already has it). Isprint
is then equivalent to [%g ].
-- Roberto