Espaces de noms
Variantes
Affichages
Actions

std::wctob

De cppreference.com
< cpp‎ | string‎ | multibyte

 
 
Bibliothèque de chaînes de caractères
Chaînes à zéro terminal
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.
Les chaînes d'octets
Chaines multi-octets
Les chaînes étendues
Classes
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
 
Chaînes à zéro terminal multi-octets
Large / multi-octets conversions
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
Types
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 );
Narrows un caractère large c si son équivalent en caractères multi-octets à l'état initial est un seul octet .
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.
C'est typiquement possible pour les caractères du jeu de caractères ASCII, puisque la plupart des encodages multi-octets (par exemple UTF-8) utiliser des octets simples pour encoder ces caractères .
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.

Sommaire

[modifier] Paramètres

c -
caractère large se réduire
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.

[modifier] Retourne la valeur

EOF si c ne représente pas un caractère multi-octets avec 1 longueur en état de décalage initial .
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.
Sinon, la représentation mono-octet de c que unsigned char converti en int
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.

[modifier] Exemple

#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'));
}

Résultat :

narrow: a
narrowed from wide: a

[modifier] Voir aussi

élargit un caractère simple octet étroite pour les caractères larges, si possible
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.

(fonction) [edit]
[
virtuel
Original:
virtual
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
convertit un ou plusieurs caractères de 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.

(fonction membre virtuelle protégée de std::ctype) [edit]
C documentation for wctob