Re: [PATCH] wip: change ISSPACE to use ascii whitespace check.
Arnt Gulbrandsen <[email protected]>
| Newsgroups | gmane.mail.mutt.devel |
|---|---|
| Message-ID | <[email protected]> |
"Kevin J. McCarthy" <[email protected]> writes: > On some platforms, isspace() returns true for unexpected 8-bit > chars, such as 0xa0 or 0x85. Given that, I don't think Mutt > should be using it in most (if not all) cases, and especially > not when parsing protocols and emails. (Note: iswspace() is a > different story; enter.c makes use of wchar_t, for instance.) > > I originally kept the locale checks in a few prompts and the > builtin editor. But the more I considered, the more I decided > it was better to explicitly use the ASCII version in each case. Today I learn: Unicode codepoint U+0085, which corresponds to ISO-8859-1 0x85, is encoded in UTF8 as 0xC2 0x85. For some reason this pleases me. The diff looks good to me. I agree with dropping just the ASCII space. I thought about dropping more in edit_headers and a few other places, but the result wouldn't have mutt's spirit. Look at https://github.com/aox/aox/blob/ac09f40db4ed55c35b86b19d75e030dae096a24c/core/ustring.cpp#L392, for example: Fine code, but not mutt-like. Arnt