This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Handling numbers input/output in glibc


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Behdad Esfahbod wrote:

> By the way, I guess it has been a misunderstanding of the C99
> standard, as I cannot verify that:
> 
> C99 section 7.4.1.5 "The isdigit function" paragraph 2 says:
> "The isdigit function tests for any decimal-digit character (as
> defined in 5.2.1)".
> 
> But in section 5.2.1, it defines the source and execution
> character sets, and divides each into two sets: base character
> set, whose contents are given by that subclause, and a set of
> zero or more locale-specific members (which are not members of
> the basic character set) called extended characters.  It requires
> the characters in basic set to be represented by one byte, but
> not for extended characters.  So I cannot see where it forbids us
> to classify non-ASCII number characters as digits.
> 
> Proposed fix should be trivial.  This magically enables everyone
> to enter numbers in their own local digits, Wow!

I don't have to read more than this: isdigit() is defined to accept the
ASCII decimal digits.  That's it.  There won't be any change.

No, the standard isn't friendly to what you want to do but too much code
depends on the existing behavior.

- -- 
â Ulrich Drepper â Red Hat, Inc. â 444 Castro St â Mountain View, CA â
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAADrt2ijCOnn/RHQRAg6tAJ0WKEa9zDnfDaBlEHJxgr12WvEwIwCgjyiq
0AxLvr29lp+QvFT8Pqvn5l8=
=EAqP
-----END PGP SIGNATURE-----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]