3 ms·
> In this case, isspace() returns true for Unicode white-space values, which includes 0x85 = NEL = Next Line, and 0xA0 = NBSP = No-Break Space. Those aren't ev
by bawolff 3y ago
> In this case, isspace() returns true for Unicode white-space values, which includes 0x85 = NEL = Next Line, and 0xA0 = NBSP = No-Break Space.
Those aren't even unicode (utf-8) bytes for those characters. They are the iso-8859-1 bytes. (E.g. nbsp is U+00A0 which has a byte representation of 0xC2 0xA0)
- kps 3y agoThe argument to `isspace()` (in that implementation) is a Unicode code point, not an encoding byte.
- Sprocklem 3y agoRight, but the only reasonable way to localize `isspace()` is to have it based on code units / encoding bytes, since that is what it will be used for. When people want to test a unicode code point they instead call `iswspace()` (or a non-standard but more-sane version thereof).
- kps 3y agoMy unverified assumption is that MacOS's behaviour here descends from NeXTStep, which used UCS-2.