Nicholas Clark <nick@ccl4.org> writes: >On Sun, Jan 21, 2001 at 01:34:05PM +0000, Hugo wrote: >> while (isDIGIT(*s)) >> count = count * 10 + (*s++ - '0'); >> .. which (I think) does the right thing with and without UTF8 under >> ASCII, and with straight EBCDIC, but not with UTF8-encoded EBCDIC. >> Similarly, we dump digits in sprintf without regard to utf8ness. >> >> Attached patch should at least avoid setting the UTF8 flag in the >> above example. (Note that the namechange 'utf' to 'vec_utf' is >> cosmetic only.) > >Hmm. This means that isDIGIT should be used only with care: Ah, we may be getting closer to the root cause ;-) > >from handy.h > >#define isDIGIT(c) ((c) >= '0' && (c) <= '9') >#ifdef EBCDIC > /* In EBCDIC we do not do locales: therefore() isupper() is fine. */ > >[followed by EBCDIC specific things] > >and we need to use isDIGIT_uni on any UTF8 string. >But will that spot digits other than 0 to 9? > >Nicholas Clark -- Nick Ing-SimmonsThread Previous | Thread Next