Espaços nominais
Variantes
Acções

std::wctob

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

 
 
Biblioteca cordas
Strings terminadas
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.
Cadeias de bytes
Multibyte cordas
Cordas de largura
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
 
Strings terminadas multibyte
Wide / multibyte conversões
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
Tipos
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 um c caráter de largura, se o seu equivalente caractere multibyte no estado deslocamento inicial é um único byte.
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.
Isto é tipicamente possível para os caracteres do conjunto de caracteres ASCII, já que a maioria codificação multibyte (como UTF-8) usar bytes únicos para codificar esses personagens.
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.

Índice

[editar] Parâmetros

c -
caráter amplo para estreitar
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.

[editar] Valor de retorno

EOF se c não representa um caractere multibyte com 1 comprimento em estado de deslocamento inicial.
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.
Caso contrário, a representação de byte único de c como unsigned char convertido para 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.

[editar] Exemplo

#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

[editar] Veja também

alarga um caractere de byte único estreita ao caráter amplo, se possível
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.

(função) [edit]
[virtual]
converte um caractere ou caracteres de charT para 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.

(virtual protegido of std::ctype função de membro) [edit]
C documentation for wctob