Non-breaking space missing from iswspace() and iswblank()

Andy Koppe andy.koppe@gmail.com
Sat Aug 22 16:31:00 GMT 2009


The iswspace and iswblank don't currently consider the "non-breaking
space" character U+00A0 as a space.

Test:
#include <ctype.h>
#include <wctype.h>
#include <locale.h>

int main(void) {
  puts(setlocale(LC_CTYPE, "en.ISO-8859-1") ?: "C");
  printf("isspace(0xA0)  == %i\n", isspace(0xA0));
  printf("iswspace(0xA0) == %i\n", iswspace(0xA0));
  printf("isblank(0xA0)  == %i\n", isblank(0xA0));
  printf("iswblank(0xA0) == %i\n", iswblank(0xA0));
  return 0;
}

Output:
isspace(0xA0)  == 8
iswspace(0xA0) == 0
isblank(0xA0)  == 1
iswblank(0xA0) == 0

Patch attached.

Regards,
Andy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nbsp.patch
Type: application/octet-stream
Size: 1194 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20090822/650005ab/attachment.obj>


More information about the Newlib mailing list