Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ wctomb(3) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

mbtowc, mbstowcs, mbstomb

setlocale

mbcsgen



WCTOMB(3,L)                 AIX Technical Reference                 WCTOMB(3,L)



-------------------------------------------------------------------------------
wctomb, wcstombs



PURPOSE

Converts wide characters and wide character strings into multibyte characters
and multibyte character strings.

SYNTAX

#include <mbcs.h>

int wctomb (s, wc)
char *s;
wchar_t wc;

size_t wcstombs (s, wcs, nb)
char *s;
wchar_t *wcs;
size_t nb;

DESCRIPTION

The wctomb subroutine converts a wide character wc to a multibyte character and
stores the results in s.  This subroutine does not check for overflow of the
array s and assumes that s contains enough room for the string.  The string s
will be NULL padded.

The wcstombs subroutine converts a wide character string wcs to a multibyte
string and stores the results in s.  Copying stops if a multibyte character
exceeds the limit of nb total bytes or if a NULL character is stored.

RETURN VALUE

The wctomb subroutine returns:

n    where n is the number of bytes needed to represent the multibyte
     character.

-1   if the value of wc does not correspond to a valid multibyte character.

0    if s is a NULL pointer or wc is a NULL character.

The wcstombs subroutine returns (size_t):

n    where n is the number of bytes converted.

-1   if a value in wcs does not correspond to a valid multibyte character.

0    if s is a NULL pointer.



Processed November 7, 1990        WCTOMB(3,L)                                 1





WCTOMB(3,L)                 AIX Technical Reference                 WCTOMB(3,L)




RELATED INFORMATION

In this book:  "mbtowc, mbstowcs, mbstomb" and "setlocale."

The mbcsgen command in AIX Operating System Commands Reference.

AIX Guide to Multibyte Character Set (MBCS) Support.















































Processed November 7, 1990        WCTOMB(3,L)                                 2



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026