[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] Feedback: remove LOCALE ifdefs?
From: |
paul vixie |
Subject: |
Re: [Nmh-workers] Feedback: remove LOCALE ifdefs? |
Date: |
Sat, 26 May 2012 20:38:32 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 |
On 5/26/2012 8:20 PM, Ken Hornstein wrote:
>> As long as we're looking at that code, we probably want to do an audit to
>> make
>> sure that we aren't using isspace() anyplace to detect rfc822 ascii-ish
>> 'whitespace'. I've seen the hilarity that ensues when the mail system at one
>> end thinks that a 'non-breaking space' is whitespace and the system at the
>> other end isn't convinced...
> Hm, I see that m_getfld() uses isspace() ... but since that hasn't seem
> to broken just yet I am reluctant to mess with it. Other uses are in
> MIME parsing ... I think that should be okay as long as the locale
> character set is a superset of ASCII. Is that normally the case?
>
> That makes me think that we should have an isasciispace() function
> that we should use for things like header and MIME parsing since
> those should always be 7-bit ASCII.
just say isascii(x) && isspace(x). this is actually necessary for any
test nowadays. if you're not using wchar_t and <wchar.h> then you have
to guard against false matches by non-ascii upper-register characters.