Was Re: Ping - pstree + minor patch
Tito
farmatito at tiscali.it
Mon Dec 6 21:22:03 UTC 2010
On Monday 06 December 2010 21:26:08 Nuno Lucas wrote:
> On Mon, Dec 6, 2010 at 17:07, Cathey, Jim <jcathey at ciena.com> wrote:
> >> > > - } else if (*here >= ' ' && *here <= '~') {
> >> > > + } else if (*here >= ' ' && *here < 0x7f) {
> >> > >
> >> > > This makes it less readable. Why replace the char with a hex
> >> > value?
> >> >
> >> > It is less obvious that '~' is the last ASCII character.
> >
> > IMHO, it is equally un-obvious that ' ' is the _first_ ASCII
> > character, of the printables. If one wants to go all pedantic
> > on the code, isprint() might be better. But I would probably
> > have left it as the original author had, as a quoted character.
>
> Actually, to be really pedantic, one should not use '~'.
> Not every codepage has '~' as the character at position 126.
>
> As an example: ISO/IEC 646:1991 German [1], has 'ß' (LATIN SMALL
> LETTER SHARP S - u+223) at the position 126.
Hi,
So as I understand it, it would be better to use numerical values
rather than characters to catch all corner cases?
Ciao,
Tito
> Look at the wikipedia article [2] for other alternatives of ASCII-126
> in this encoding.
>
> This are obsolete codepages, but they still exist (and sometimes you
> actually need to use them when talking with legacy devices, like old
> printers, or industrial scales).
>
> It was only with ISO-8859-* [3] that the lower 7-bit ASCII characters
> were fixed.
>
>
> Regards,
> ~Nuno Lucas
More information about the busybox
mailing list