table of contents
- trixie 4.27.0-1
- trixie-backports 4.29.1-1~bpo13+1
- testing 4.29.1-1
- unstable 4.29.1-1
| mbtowc(3) | Library Functions Manual | mbtowc(3) |
NOM¶
mbtowc - Convertir une séquences multioctet en caractères larges
BIBLIOTHÈQUE¶
Bibliothèque C standard (libc, -lc)
SYNOPSIS¶
#include <stdlib.h>
int mbtowc(size_t size;
wchar_t *restrict pwc, const char s[restrict size],
size_t size);
DESCRIPTION¶
The main case for this function is when s is not NULL and pwc is not NULL. In this case, the mbtowc() function inspects at most size 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 an internal shift state known only to the mbtowc() function. If s does not point to a null byte ('\0'), it returns the number of bytes that were consumed from s, otherwise it returns 0.
If the size bytes starting at s do not contain a complete multibyte character, or if they contain an invalid multibyte sequence, mbtowc() returns -1. This can happen even if size >= MB_CUR_MAX, if the multibyte string contains redundant shift sequences.
Un autre cas possible se présent si s est non NULL, mais pwc est NULL. Dans ce cas, la fonction mbtowc() se comporte comme ci-dessus, mais ne stocke par le caractère large en mémoire.
A third case is when s is NULL. In this case, pwc and size are ignored. The mbtowc() function resets the shift state, only known to this function, to the initial state, and returns nonzero if the encoding has nontrivial shift state, or zero if the encoding is stateless.
VALEUR RENVOYÉE¶
Si s est non NULL, la fonction mbtowc() renvoie le nombre d'octets consommés à partir de s, ou zéro si s pointe sur un octet nul, ou encore -1 en cas d'erreur.
Si s est NULL, la fonction mbtowc() renvoie une valeur non nulle si l'encodage a un état de décalage non trivial, ou zéro si l'encodage est sans état.
ATTRIBUTS¶
Pour une explication des termes utilisés dans cette section, consulter attributes(7).
| Interface | Attribut | Valeur |
| mbtowc() | Sécurité des threads | MT-Unsafe race |
VERSIONS¶
Cette fonction n'est pas sûre en contexte multithread. La fonction mbrtowc(3) fournit une meilleure interface pour la même fonctionnalité.
STANDARDS¶
C11, POSIX.1-2008.
HISTORIQUE¶
POSIX.1-2001, C99.
NOTES¶
Le comportement de mbtowc() dépend de la catégorie LC_CTYPE de la localisation en cours.
VOIR AUSSI¶
MB_CUR_MAX(3), mblen(3), mbrtowc(3), mbstowcs(3), wcstombs(3), wctomb(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> et Jean-Pierre Giraud <jean-pierregiraud@neuf.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.
| 7 septembre 2025 | Pages du manuel de Linux 6.16 |