Namespaces
Variants

iswcntrl

From cppreference.net
< c ‎ | string ‎ | wide
ヘッダーで定義 <wctype.h>
int iswcntrl ( wint_t ch ) ;
(C95以降)

指定されたワイド文字が制御文字かどうかをチェックします。つまり、コード 0x00-0x1F および 0x7F と、現在のロケール固有の制御文字が対象です。

目次

パラメータ

ch - ワイド文字

戻り値

ワイド文字が制御文字である場合は非ゼロ値、それ以外の場合はゼロ。

注記

ISO 30112 は、POSIX制御文字をUnicode文字U+0000..U+001F、U+007F..U+009F、U+2028、およびU+2029(UnicodeクラスCc、Zl、Zp)として定義しています

#include <locale.h>
#include <stdio.h>
#include <wchar.h>
#include <wctype.h>
int main(void)
{
    wchar_t c = L'\u2028'; // Unicode文字「行区切り文字」
    printf("In the default locale, iswcntrl(%#x) = %d\n", c, !!iswcntrl(c));
    setlocale(LC_ALL, "en_US.utf8");
    printf("In Unicode locale, iswcntrl(%#x) = %d\n", c, !!iswcntrl(c));
}

出力:

In the default locale, iswcntrl(0x2028) = 0
In Unicode locale, iswcntrl(0x2028) = 1

参考文献

  • C23規格 (ISO/IEC 9899:2024):
  • 7.30.2.1.4 iswcntrl関数 (p: TBD)
  • C17規格 (ISO/IEC 9899:2018):
  • 7.30.2.1.4 iswcntrl関数 (p: TBD)
  • C11規格 (ISO/IEC 9899:2011):
  • 7.30.2.1.4 iswcntrl関数 (p: 449)
  • C99規格 (ISO/IEC 9899:1999):
  • 7.25.2.1.4 iswcntrl関数 (p: 395)

関連項目

文字が制御文字かどうかをチェックする
(関数)
C++ documentation for iswcntrl
HTMLタグ、属性、および` `タグ内のテキストは翻訳せず、元のフォーマットを保持しました。数値範囲「71–90」はそのまま維持されています。
ASCII値 文字

iscntrl
iswcntrl

isprint
iswprint

isspace
iswspace

isblank
iswblank

isgraph
iswgraph

ispunct
iswpunct

isalnum
iswalnum

isalpha
iswalpha

isupper
iswupper

islower
iswlower

isdigit
iswdigit

isxdigit
iswxdigit

10進数 16進数 8進数
0–8 \x0 \x8 \0 \10 制御コード ( NUL など) ≠0 0 0 0 0 0 0 0 0 0 0 0
9 \x9 \11 タブ ( \t ) ≠0 0 ≠0 ≠0 0 0 0 0 0 0 0 0
10–13 \xA \xD \12 \15 空白文字 ( \n , \v , \f , \r ) ≠0 0 ≠0 0 0 0 0 0 0 0 0 0
14–31 \xE \x1F \16 \37 制御コード ≠0 0 0 0 0 0 0 0 0 0 0 0
32 \x20 \40 スペース 0 ≠0 ≠0 ≠0 0 0 0 0 0 0 0 0
33–47 \x21 \x2F \41 \57 !"#$%&'()*+,-./ 0 ≠0 0 0 ≠0 ≠0 0 0 0 0 0 0
48–57 \x30 \x39 \60 \71 0123456789 0 ≠0 0 0 ≠0 0 ≠0 0 0 0 ≠0 ≠0
58–64 \x3A \x40 \72 \100 :;<=>?@ 0 ≠0 0 0 ≠0 ≠0 0 0 0 0 0 0
65–70 \x41 \x46 \101 \106 ABCDEF 0 ≠0 0 0 ≠0 0 ≠0 ≠0 ≠0 0 0 ≠0
71–90 \x47 \x5A \107 \132 GHIJKLMNOP
QRSTUVWXYZ
0 ≠0 0 0 ≠0 0 ≠0 ≠0 ≠0 0 0 0
91–96 \x5B \x60 \133 \140 [\]^_` 0 ≠0 0 0 ≠0 ≠0 0 0 0 0 0 0
97–102 \x61 \x66 \141 \146 abcdef 0 ≠0 0 0 ≠0 0 ≠0 ≠0 0 ≠0 0 ≠0
103–122 \x67 \x7A \147 \172 ghijklmnop
qrstuvwxyz
0 ≠0 0 0 ≠0 0 ≠0 ≠0 0 ≠0 0 0
123–126 \x7B \x7E \173 \176 {|}~ 0 ≠0 0 0 ≠0 ≠0 0 0 0 0 0 0
127 \x7F \177 バックスペース文字 ( DEL ) ≠0 0 0 0 0 0 0 0 0 0 0 0