develooper Front page | perl.perl5.porters | Postings from January 2001

Re: 8482 busted for $^V sprintf()s on OS/390

Thread Previous | Thread Next
From:
nick
Date:
January 21, 2001 07:54
Subject:
Re: 8482 busted for $^V sprintf()s on OS/390
Message ID:
E14KMmM-0006SK-00@roam1
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-Simmons


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About