by torstenvl · 4y ago · 0 comments
I found something interesting while trying to add a test case. I had to come up with something that would fail iswalnum() in ranges above 128, and I knew Japanese has its own punctuation marks, so I tried that. However, apparently, iswxxxxx is broken for East Asian languages and Arabic in macOS's system library (including with locale set to, e.g., ja_JP.UTF-8). There are characters for which iswalpha, iswcntrl, iswdigit, iswpunct, and iswspace are all false, in violation of the standard.
For the purposes of testing my library (rather than underlying OS locale support), I ended up going with Armenian, but it's a disappointing issue nonetheless.
I may have to roll my own at some point.