Email List: Xaustin-review-lX
[All Lists]

Re: Defect in XBD LC_CTYPE

To: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Re: Defect in XBD LC_CTYPE
From: Ienup Sung <yy@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 01 May 2003 13:08:15 -0700 (PDT)
I see symbolic names and literals used in the spec differently and I'm
quite sure that's not just me. For instance, <zero> could be 0x30 or 0xa5
depending on your locale's codeset but the literal 0 is always the <zero> of
the portable character set of the implementation.

In that sense, we could distinguish <zero> and '0'. Maybe we need to have
more definitions on the literals.

With regards,

Ienup


] Date: Thu, 01 May 2003 20:29:49 +0100
] From: "Clive D.W. Feather" <yyyyy@xxxxxxxxx>
] Subject: Re: Defect in XBD LC_CTYPE
] To: Ienup Sung <yyyyyyyyyy@xxxxxxxxxxx>
] Cc: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
] MIME-version: 1.0
] 
] Ienup Sung said:
] > digit Define the following ten decimal digit characters to be classified as
] >       numeric digits:
] > 
] >     <zero> <one> <two> <three> <four> <five> <six> <seven> <eight> <nine>
] > 
] >      In the POSIX locale, those shall be:
] 
] In *all* locales these shall be:
] 
] >           0 1 2 3 4 5 6 7 8 9
] 
] In C, the ten values that isdigit() is true for are the ones represented
] in source code by '0' to '9' *no matter what the locale is*. These values
] are fixed at compile time. The function:
] 
]     void check_isdigit (void)
]     {
]         setlocale ( /* ANY ARGUMENTS YOU LIKE */ );
] 
]         for (int uc = 0; uc <= UCHAR_MAX; uc++)
]             if ((uc >= '0' && uc <= '0' + 9) != !!isdigit (uc))
]                 fprintf (stderr, "Implementation does not conform.\n");
]         if (isdigit (EOF)
]             fprintf (stderr, "Implementation does not conform.\n");
]     }
] 
] does not generate output in any conforming implementation.
] 
] -- 
] Clive D.W. Feather  | Work:  <yyyyy@xxxxxxxxx>   | Tel:    +44 20 8495 6138
] Internet Expert     | Home:  <yyyyy@xxxxxxxxxx>  | *** NOTE CHANGE ***
] Demon Internet      | WWW: http://www.davros.org | Fax:    +44 870 051 9937
] Thus plc            |                            | Mobile: +44 7973 377646

<Prev in Thread] Current Thread [Next in Thread>