iswspace
提供: cppreference.com
ヘッダ <wctype.h> で定義 | ||
int iswspace( wint_t ch ); | (C95以上) | |
現在設定されている C のロケールによる分類において、指定されたワイド文字がホワイトスペース文字、すなわち空白 (0x20
)、改頁 (0x0c
)、改行 (0x0a
)、復帰 (0x0d
)、水平タブ (0x09
)、垂直タブ (0x0b
)、または現在のロケール固有のいずれかのホワイトスペース文字かどうかを調べます。
目次 |
[編集]引数
ch | - | ワイド文字 |
[編集]戻り値
ワイド文字がホワイトスペース文字であれば非ゼロの値、そうでなければゼロ。
[編集]ノート
ISO 30112 は POSIX の空白文字を Unicode の文字 U+0009..U+000D、 U+0020、 U+1680、 U+180E、 U+2000..U+2006、 U+2008..U+200A、 U+2028、 U+2029、 U+205F および U+3000 として定義しています。
[編集]例
Run this code
#include <stdio.h>#include <wchar.h>#include <wctype.h>#include <locale.h> int main(void){wchar_t c = L'\u2003';// Unicode character 'EM SPACE'printf("in the default locale, iswspace(%#x) = %d\n", c, !!iswspace(c));setlocale(LC_ALL, "en_US.utf8");printf("in Unicode locale, iswspace(%#x) = %d\n", c, !!iswspace(c));}
出力:
in the default locale, iswspace(0x2003) = 0 in Unicode locale, iswspace(0x2003) = 1
[編集]参考文献
- C11 standard (ISO/IEC 9899:2011):
- 7.30.2.1.10 The iswspace function (p: 450-451)
- C99 standard (ISO/IEC 9899:1999):
- 7.25.2.1.10 The iswspace function (p: 396-397)
[編集]関連項目
文字がスペース文字かどうか調べます (関数) | |
iswspace の C++リファレンス |
ASCII値 (16進) | 文字 | isspace | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 - 8 | 0x00-0x08 | 制御コード (NUL など) | ≠0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9 | 0x09 | タブ (\t ) | ≠0 | 0 | ≠0 | ≠0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
10 - 13 | 0x0A-0x0D | ホワイトスペース (\n ,\v ,\f ,\r ) | ≠0 | 0 | ≠0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
14 - 31 | 0x0E-0x1F | 制御文字 | ≠0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
32 | 0x20 | スペース | 0 | ≠0 | ≠0 | ≠0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
33 - 47 | 0x21-0x2F | !"#$%&'()*+,-./ | 0 | ≠0 | 0 | 0 | ≠0 | ≠0 | 0 | 0 | 0 | 0 | 0 | 0 |
48 - 57 | 0x30-0x39 | 0123456789 | 0 | ≠0 | 0 | 0 | ≠0 | 0 | ≠0 | 0 | 0 | 0 | ≠0 | ≠0 |
58 - 64 | 0x3a-0x40 | :;<=>?@ | 0 | ≠0 | 0 | 0 | ≠0 | ≠0 | 0 | 0 | 0 | 0 | 0 | 0 |
65 - 70 | 0x41-0x46 | ABCDEF | 0 | ≠0 | 0 | 0 | ≠0 | 0 | ≠0 | ≠0 | ≠0 | 0 | 0 | ≠0 |
71 - 90 | 0x47-0x5A | GHIJKLMNOPQRSTUVWXYZ | 0 | ≠0 | 0 | 0 | ≠0 | 0 | ≠0 | ≠0 | ≠0 | 0 | 0 | 0 |
91 - 96 | 0x5B-0x60 | [\]^_` | 0 | ≠0 | 0 | 0 | ≠0 | ≠0 | 0 | 0 | 0 | 0 | 0 | 0 |
97 -102 | 0x61-0x66 | abcdef | 0 | ≠0 | 0 | 0 | ≠0 | 0 | ≠0 | ≠0 | 0 | ≠0 | 0 | ≠0 |
103-122 | 0x67-0x7A | ghijklmnopqrstuvwxyz | 0 | ≠0 | 0 | 0 | ≠0 | 0 | ≠0 | ≠0 | 0 | ≠0 | 0 | 0 |
123-126 | 0x7B-0x7E | {|}~ | 0 | ≠0 | 0 | 0 | ≠0 | ≠0 | 0 | 0 | 0 | 0 | 0 | 0 |
127 | 0x7F | 削除文字 (DEL ) | ≠0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |