I am sorry, I forgot to mention important detail: _BLANK is used to implement 
`is[w]print` macros in `[w]ctype.h`. This means that they may return non-zero 
for tab in some cases.

It is been quite a while since I discovered it, and some details have slipped 
my mind.

Disregard my comment regarding *correct* return value in "C" locale. Actually, 
there is a comment in Microsoft headers saying that _BLANK only handles space 
character and that tab should be handled separately.

- Kirill Makurin
________________________________
From: Kirill Makurin <maiddais...@outlook.com>
Sent: Sunday, June 1, 2025 7:46 PM
To: mingw-w64-public <mingw-w64-public@lists.sourceforge.net>
Subject: [Mingw-w64-public] is[w]ctype disagree whether tab is _BLANK

Hi,

(It is not directly related to mingw-w64, but this got me very confused and 
this issue is related to CRTs.)

The `_isctype('\t', _BLANK)` and `iswctype(L'\t', _BLANK)` disagree. They 
disagree not only for different locales (which would make sense), but also for 
different CRTs.

I attached a simple program which can be used to reproduce this behavior. 
Here's the summary:

MSVCRT, "C" locale:

```
_isctype: 0
iswctype: 1
```

MSVCRT, locales other than "C":

```
_isctype: 1
iswctype: 1
```

UCRT, "C" locale:

```
_isctype: 0
iswctype: 0
```

UCRT, locales other than "C":

```
_isctype: 1
iswctype: 0
```

If I am correct, both should return non-zero in "C" locale.

I compared this to behavior of is[w]blank in glibc. They always return non-zero.

- Kirill Makurin

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to