Espaces de noms
Variantes
Affichages
Actions

mbstowcs

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

 
 
 
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 <stdlib.h>
size_t mbstowcs( wchar_t* dst, const char* src, size_t len)
Convertit une chaîne de caractères multi-octets à partir du tableau dont le premier élément est pointé par src à sa représentation de caractères larges. Caractères convertis sont stockés dans les éléments successifs de la chaîne pointée par dst. Pas plus de caractères len larges sont écrits dans le tableau de destination .
Original:
Converts a multibyte character string from the array whose first element is pointed to by src to its wide character representation. Converted characters are stored in the successive elements of the array pointed to by dst. No more than len wide characters are written to the destination array.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Chaque personnage est transformé comme par un appel à mbtowc, sauf que l'état de conversion mbtowc n'est pas affectée. La conversion s'arrête si:
Original:
Each character is converted as if by a call to mbtowc, except that the mbtowc conversion state is unaffected. The conversion stops if:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • Le caractère multi-octets nuls été converties et stockées .
    Original:
    The multibyte null character was converted and stored.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • Un invalide (dans la locale courante C) caractères multi-octets a été rencontrée .
    Original:
    An invalid (in the current C locale) multibyte character was encountered.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • Le caractère suivant à stocker dépasse len .
    Original:
    The next wide character to be stored would exceed len.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

Sommaire

[modifier] Notes

Dans la plupart des implémentations, cette fonction met à jour un objet statique global de mbstate_t type qu'il traite par le biais de la chaîne, et ne peut pas être appelée simultanément par deux threads, mbsrtowcs doit être utilisé dans de tels cas .
Original:
In most implementations, this function updates a global static object of type mbstate_t as it processes through the string, and cannot be called simultaneously by two threads, mbsrtowcs should be used in such cases.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
POSIX spécifie une extension de sens: si dst est un pointeur NULL, cette fonction renvoie le nombre de caractères larges qui seraient écrits à dst, si converti. Un comportement similaire est standard pour mbsrtowcs .
Original:
POSIX specifies a common extension: if dst is a null pointer, this function returns the number of wide characters that would be written to dst, if converted. Similar behavior is standard for mbsrtowcs.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Paramètres

dst -
pointeur sur un tableau de caractères larges où la chaîne de large sera stocké
Original:
pointer to wide character array where the wide string will be stored
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
src -
pointeur vers le premier élément d'une chaîne à zéro terminal multi-octets à convertir
Original:
pointer to the first element of a null-terminated multibyte string to convert
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
len -
nombre de caractères larges disponibles dans le tableau pointé par dst
Original:
number of wide characters available in the array pointed to by dst
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

En cas de succès, retourne le nombre de caractères larges, à l'exclusion du L'\0' fin, écrit au tableau de destination .
Original:
On success, returns the number of wide characters, excluding the terminating L'\0', written to the destination array.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
En cas d'erreur de conversion (si non valide a été rencontré caractères multi-octets), les rendements (size_t)-1 .
Original:
On conversion error (if invalid multibyte character was encountered), returns (size_t)-1.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Exemple

[modifier] Voir aussi

convertit une chaîne de caractères multi-octets en une chaîne de caractère étroit de large, état donné
Original:
converts a narrow multibyte character string to wide string, given state
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction) [edit]
convertit une chaîne large pour réduire chaîne de caractères multi-octets
Original:
converts a wide string to narrow multibyte character string
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction) [edit]
C++ documentation for mbstowcs