.\" -*- coding: UTF-8 -*- '\" t .\" Copyright, Bruno Haible .\" Copyright, the authors of the Linux man-pages project .\" .\" SPDX-License-Identifier: GPL-2.0-or-later .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH mbtowc 3 "8 février 2026" "Linux man\-pages 6.18" .SH NOM mbtowc \- Convertir une séquences multioctet en caractères larges .SH BIBLIOTHÈQUE Bibliothèque C standard (\fIlibc\fP,\ \fI\-lc\fP) .SH SYNOPSIS .nf \fB#include \fP .P \fBint mbtowc(\fPsize_t size; \fB wchar_t *restrict \fP\fIpwc\fP\fB, const char \fP\fIs\fP\fB[restrict \fP\fIsize\fP\fB],\fP \fB size_t \fP\fIsize\fP\fB);\fP .fi .SH DESCRIPTION The main case for this function is when \fIs\fP is not NULL and \fIpwc\fP is not NULL. In this case, the \fBmbtowc\fP() function inspects at most \fIsize\fP bytes of the multibyte string starting at \fIs\fP, extracts the next complete multibyte character, converts it to a wide character and stores it at \fI*pwc\fP. It updates an internal shift state known only to the \fBmbtowc\fP() function. If \fIs\fP does not point to a null byte (\[aq]\[rs]0\[aq]), it returns the number of bytes that were consumed from \fIs\fP, otherwise it returns 0. .P If the \fIsize\fP bytes starting at \fIs\fP do not contain a complete multibyte character, or if they contain an invalid multibyte sequence, \fBmbtowc\fP() returns \-1. This can happen even if \fIsize\fP >= \fIMB_CUR_MAX\fP, if the multibyte string contains redundant shift sequences. .P Un autre cas possible se présent si \fIs\fP est non NULL, mais \fIpwc\fP est NULL. Dans ce cas, la fonction \fBmbtowc\fP() se comporte comme ci\-dessus, mais ne stocke par le caractère large en mémoire. .P .\" The Dinkumware doc and the Single UNIX specification say this, but .\" glibc doesn't implement this. A third case is when \fIs\fP is NULL. In this case, \fIpwc\fP and \fIsize\fP are ignored. The \fBmbtowc\fP() 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. .SH "VALEUR RENVOYÉE" Si \fIs\fP est non NULL, la fonction \fBmbtowc\fP() renvoie le nombre d'octets consommés à partir de \fIs\fP, ou zéro si \fIs\fP pointe sur un octet nul, ou encore \-1 en cas d'erreur. .P Si \fIs\fP est NULL, la fonction \fBmbtowc\fP() 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. .SH ATTRIBUTS Pour une explication des termes utilisés dans cette section, consulter \fBattributes\fP(7). .TS allbox; lbx lb lb l l l. Interface Attribut Valeur T{ .na .nh \fBmbtowc\fP() T} Sécurité des threads MT\-Unsafe race .TE .SH VERSIONS Cette fonction n'est pas sûre en contexte multithread. La fonction \fBmbrtowc\fP(3) fournit une meilleure interface pour la même fonctionnalité. .SH NORMES C11, POSIX.1\-2008. .SH HISTORIQUE POSIX.1\-2001, C99. .SH NOTES Le comportement de \fBmbtowc\fP() dépend de la catégorie \fBLC_CTYPE\fP de la localisation en cours. .SH "VOIR AUSSI" \fBMB_CUR_MAX\fP(3), \fBmblen\fP(3), \fBmbrtowc\fP(3), \fBmbstowcs\fP(3), \fBwcstombs\fP(3), \fBwctomb\fP(3) .PP .SH TRADUCTION La traduction française de cette page de manuel a été créée par Christophe Blaess , Stéphan Rafin , Thierry Vignaud , François Micaux, Alain Portal , Jean-Philippe Guérard , Jean-Luc Coulon (f5ibh) , Julien Cristau , Thomas Huriaux , Nicolas François , Florentin Duneau , Simon Paillard , Denis Barbier , David Prévot et Jean-Pierre Giraud . .PP Cette traduction est une documentation libre ; veuillez vous reporter à la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License version 3 .UE concernant les conditions de copie et de distribution. Il n'y a aucune RESPONSABILITÉ LÉGALE. .PP Si vous découvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message à .MT debian-l10n-french@lists.debian.org .ME .