Man page - mbrtowc(3)

Packages contains this manual

Available languages:

en fr es ja ru ro

Manual

mbrtowc

NOM
BIBLIOTHÈQUE
SYNOPSIS
DESCRIPTION
VALEUR RENVOYÉE
ATTRIBUTS
STANDARDS
HISTORIQUE
NOTES
VOIR AUSSI
TRADUCTION

NOM

mbrtowc - Convertir une séquence multioctet en caractÚre large

BIBLIOTHÈQUE

BibliothĂšque C standard ( libc , -lc )

SYNOPSIS

#include <wchar.h>

size_t mbrtowc(wchar_t *restrict pwc , const char s [restrict . n ],
size_t
n , mbstate_t *restrict ps );

DESCRIPTION

The main case for this function is when s is not NULL and pwc is not NULL. In this case, the mbrtowc () function inspects at most n bytes of the multibyte string starting at s , extracts the next complete multibyte character, converts it to a wide character and stores it at *pwc . It updates the shift state *ps . If the converted wide character is not L'\0' (the null wide character), it returns the number of bytes that were consumed from s . If the converted wide character is L'\0', it resets the shift state *ps to the initial state and returns 0.

Si les n octets commençant en s ne contiennent pas de caractĂšre large complet, mbrtowc () renvoie (size_t) -2 . Cela peut se produire mĂȘme si n >= MB_CUR_MAX , lorsque la sĂ©quence multioctet contient des sĂ©quences de dĂ©calage redondantes.

Si la séquence multioctet commençant en s contient une séquence invalide avant le prochain caractÚre complet, mbrtowc () renvoie (size_t) -1 et place dans errno la valeur EILSEQ . Dans ce cas, les effets sur *ps sont indéfinis.

Une autre situation est possible, si s est non NULL, mais pwc est NULL. Dans ce cas, mbrtowc () se comporte comme prĂ©cĂ©demment, mais n’enregistre pas le caractĂšre large obtenu.

Un troisiĂšme cas se prĂ©sente si s est NULL. Alors, pwc et n sont ignorĂ©s. Si l’état de conversion reprĂ©sentĂ© par *ps indique une conversion multioctet incomplĂšte, la fonction mbrtowc () renvoie (size_t) -1 , remplie errno avec EILSEQ , et laisse *ps dans un Ă©tat indĂ©fini. Sinon, la fonction mbrtowc () replace *ps dans l’état initial et renvoie 0.

Dans tous ces cas, si ps est un pointeur NULL, une zone de mĂ©moire statique propre Ă  mbrtowc () est utilisĂ©e Ă  sa place. Sinon, *ps doit ĂȘtre un objet mbstate_t valide. Un tel objet mbstate_t notĂ© a peut ĂȘtre initialisĂ© en le mettant Ă  zĂ©ro, par exemple ainsi :

memset(&a, 0, sizeof(a));

VALEUR RENVOYÉE

The mbrtowc () function returns the number of bytes parsed from the multibyte sequence starting at s , if a non-L'\0' wide character was recognized. It returns 0, if a L'\0' wide character was recognized. It returns (size_t) -1 and sets errno to EILSEQ , if an invalid multibyte sequence was encountered. It returns (size_t) -2 if it couldn’t parse a complete multibyte character, meaning that n should be increased.

ATTRIBUTS

Pour une explication des termes utilisés dans cette section, consulter attributes (7).

Image grohtml-3895694-1.png

STANDARDS

C11, POSIX.1-2008.

HISTORIQUE

POSIX.1-2001, C99.

NOTES

Le comportement de mbrtowc () dépend de la catégorie LC_CTYPE de la localisation en cours.

VOIR AUSSI

mbsinit (3), mbsrtowcs (3)

TRADUCTION

La traduction française de cette page de manuel a été créée par Christophe Blaess <https://www.blaess.fr/christophe/>, Stéphan Rafin <stephan.rafin@laposte.net>, Thierry Vignaud <tvignaud@mandriva.com>, François Micaux, Alain Portal <aportal@univ-montp2.fr>, Jean-Philippe Guérard <fevrier@tigreraye.org>, Jean-Luc Coulon (f5ibh) <jean-luc.coulon@wanadoo.fr>, Julien Cristau <jcristau@debian.org>, Thomas Huriaux <thomas.huriaux@gmail.com>, Nicolas François <nicolas.francois@centraliens.net>, Florentin Duneau <fduneau@gmail.com>, Simon Paillard <simon.paillard@resel.enst-bretagne.fr>, Denis Barbier <barbier@debian.org>, David Prévot <david@tilapin.org>, Jean-Baptiste Holcroft <jean-baptiste@holcroft.fr> et Grégoire Scano <gregoire.scano@malloc.fr>

Cette traduction est une documentation libre ; veuillez vous reporter à la GNU General Public License version 3 concernant les conditions de copie et de distribution. Il n’y a aucune RESPONSABILITÉ LÉGALE.

Si vous découvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message à debian-l10n-french@lists.debian.org .