名前空間
変種
操作

std::wctob

提供: cppreference.com
< cpp‎ | string‎ | multibyte

 
 
ストリングスライブラリ
NULLで終わる文字列
Original:
Null-terminated strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
バイト文字列
文字列をマルチバイト
ワイド文字列
クラス
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string
char_traits
 
NULLで終わるマルチバイト文字列
マルチバイト/ワイドコンバージョン
Original:
Wide/multibyte conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
mbsinit
タイプ
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
mbstate_t
 
Defined in header <cwchar>
int wctob( std::wint_t c );
初期シフト状態でのマルチバイト文字と同等であればワイド文字cを狭めるシングルバイト.
Original:
Narrows a wide character c if its multibyte character equivalent in the initial shift state is a single byte.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
.
Original:
This is typically possible for the characters from the ASCII character set, since most multibyte encodings (such as UTF-8) use single bytes to encode those characters.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] パラメータ

c -
絞り込むためにワイド文字
Original:
wide character to narrow
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

EOFcマルチバイト文字を表していない場合、ほとんどのマルチバイトエンコーディングは(UTF-8など)は、それらの文字をエンコードするために単一のバイトを使っているのでこれは、ASCII文字セットの文字のために一般的に可能である初期シフト状態での長さを持つ1.
Original:
EOF if c does not represent a multibyte character with length 1 in initial shift state.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
それ以外の場合は、等価性の検討が必要にcなどの文字はロケールによって空白として分類されている場合unsigned charint
Original:
Otherwise, the single-byte representation of c as unsigned char converted to int
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集]

#include <cwchar>
#include <cstdio>
#include <clocale>
 
int main()
{
    std::setlocale(LC_ALL, "");
    std::printf("narrow: %c\nnarrowed from wide: %c\n", 'a', std::wctob(L'a'));
}

Output:

narrow: a
narrowed from wide: a

[編集] も参照してください

可能であれば、ワイド文字をシングルバイトの狭い文字を広げる
Original:
widens a single-byte narrow character to wide character, if possible
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(関数) [edit]
[仮想]
charTからcharへの文字または文字列に変換します
Original:
converts a character or characters from charT to char
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(仮想protectedメンバ関数of std::ctype) [edit]
C documentation for wctob