.\" -*- 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 wcrtomb 3 "8 февраля 2026 г." "Linux man\-pages 6.18" .SH НАИМЕНОВАНИЕ wcrtomb \- преобразование широкого символа в многобайтовую последовательность .SH БИБЛИОТЕКА Стандартная библиотека языка C (\fIlibc\fP,\ \fI\-lc\fP) .SH СИНТАКСИС .nf \fB#include \fP .P \fBsize_t wcrtomb(char *restrict \fP\fIs\fP\fB, wchar_t \fP\fIwc\fP\fB, mbstate_t *restrict \fP\fIps\fP\fB);\fP .fi .SH ОПИСАНИЕ The main case for this function is when \fIs\fP is not NULL and \fIwc\fP is not a null wide character (L\[aq]\[rs]0\[aq]). In this case, the \fBwcrtomb\fP() function converts the wide character \fIwc\fP to its multibyte representation and stores it at the beginning of the character array pointed to by \fIs\fP. It updates the shift state \fI*ps\fP, and returns the length of said multibyte representation, that is, the number of bytes written at \fIs\fP. .P A different case is when \fIs\fP is not NULL, but \fIwc\fP is a null wide character (L\[aq]\[rs]0\[aq]). In this case, the \fBwcrtomb\fP() function stores at the character array pointed to by \fIs\fP the shift sequence needed to bring \fI*ps\fP back to the initial state, followed by a \[aq]\[rs]0\[aq] byte. It updates the shift state \fI*ps\fP (i.e., brings it into the initial state), and returns the length of the shift sequence plus one, that is, the number of bytes written at \fIs\fP. .P Третий случай — это когда \fIs\fP равно NULL. Тогда \fIwc\fP игнорируется, а функция возвращает .P .in +4n .EX wcrtomb(buf, L\[aq]\[rs]0\[aq], ps) .EE .in .P где \fIbuf\fP — внутренний анонимный буфер. .P Во всех вышеперечисленных случаях, если \fIps\fP равно NULL, то используется статическое анонимное состояние, известное только функции \fBwcrtomb\fP(). .P At most \fBMB_CUR_MAX\fP bytes will be written at \fIs\fP. The programmer must ensure that there is enough room to store the multibyte sequence at \fIs\fP. .SH "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ" Функция \fBwcrtomb\fP() возвращает количество байтов, которые уже записаны или должны быть записаны в массив, на который указывает \fIs\fP. Если значение \fIwc\fP не может быть представлено как многобайтовая последовательность (в соответствии с текущей локалью), то возвращается \fI(size_t)\ \-1\fP, а \fIerrno\fP присваивается значение \fBEILSEQ\fP. .SH АТРИБУТЫ Описание терминов данного раздела смотрите в \fBattributes\fP(7). .TS allbox; lbx lb lb l l l. Интерфейс Атрибут Значение T{ .na .nh \fBwcrtomb\fP() T} Безвредность в нитях MT\-Unsafe race:wcrtomb/!ps .TE .SH СТАНДАРТЫ C11, POSIX.1\-2008. .SH ИСТОРИЯ POSIX.1\-2001, C99. .SH ПРИМЕЧАНИЯ Поведение \fBwcrtomb\fP() зависит от категории \fBLC_CTYPE\fP текущей локали. .P Передавать NULL в качестве \fIps\fP небезопасно при работе с нитями. .SH "СМОТРИТЕ ТАКЖЕ" \fBmbsinit\fP(3), \fBwcsrtombs\fP(3) .PP .SH ПЕРЕВОД Русский перевод этой страницы руководства разработал(и) Azamat Hackimov и Yuri Kozlov . .PP Этот перевод является свободной программной документацией; он распространяется на условиях общедоступной лицензии GNU (GNU General Public License - GPL, .UR https://www.gnu.org/licenses/gpl-3.0.html .UE версии 3 или более поздней) в отношении авторского права, но БЕЗ КАКИХ-ЛИБО ГАРАНТИЙ. .PP Если вы обнаружите какие-либо ошибки в переводе этой страницы руководства, пожалуйста, сообщите об этом разработчику(ам) по его(их) адресу(ам) электронной почты или по адресу .MT debian-l10n-russian@lists.debian.org списка рассылки русских переводчиков .ME .