wctomb(3int)wctomb(3int)Name
wctomb - converts a character of type wchar_t to a multibyte character.
Syntax
#include <stdlib.h>
int wctomb (s, wchar)
char *s;
wchar_t wchar;
Arguments
s The s argument is a pointer to the resulting multibyte character object.
wchar The wchar argument is a value of type wchar_t.
Description
The function determines the number of bytes needed to represent the multibyte character corresponding to the character code of type wchar_t
whose value is wchar. It stores the multibyte character representation in the array object pointed to by s (if s is not a null pointer).
At most MB_CUR_MAX characters are stored. This function is affected by the LC_CTYPE category of the current locale.
Return Value
If s is a null pointer, the function returns a zero value. If s is not a null pointer, the function returns:
o - -1, if the value of wchar does not correspond to a valid multibye character
o The number of bytes that comprise the multibyte character corresponding to the value of wchar. In no case is the value returned
greater than the value of the MB_CUR_MAX macro.
See Alsomblen(3int), mbtowc(3int), mbstowcs(3int), setlocale(3int), wcstombs(3int)wctomb(3int)
Check Out this Related Man Page
mbtowc(3int)mbtowc(3int)Name
mbtowc - converts a single multibyte character into a character of type wchar_t
Syntax
#include <stdlib.h>
int mbtowc (pwc, s, n)
wchar_t *pwc;
const char *s;
size_t n;
Arguments
pwc The pwc argument is a pointer to the resulting object of type wchar_t.
s The s argument is a pointer to a multibyte character.
n The n argument is the maximum number of bytes of object s that are examined.
Description
If s is not a null pointer, the function determines the number of bytes that comprise the multibyte character pointed to by s. It then
determines the character code for the value (of type wchar_t) that corresponds to that multibyte character (the value of the code corre-
sponding to the null character is zero). If the multibyte character is valid and pwc is not a null pointer, the function stores the code in
the object pointed to by pwc. At most n bytes of the array pointed to by s are examined. This function is affected by the LC_CTYPE cate-
gory of the current locale.
Return Values
If s is a null pointer, the function returns a zero value. If s is not a null pointer, the function returns:
o 0, if s points to the null character
o The number of bytes that comprise the converted multibye character, if the next n or fewer bytes form a valid multibye character
o - -1, if the next n or fewer bytes do not form a valid multibye character
In no case is the value returned greater than n or the value of the MB_CUR_MAX macro.
See Alsomblen(3int), mbstowcs(3int), setlocale(3int), wctomb(3int), wcstombs(3int)mbtowc(3int)
I'm testing out some ESMTP AUTH stuff, and it requires that the username and password be on the same line separated by a null character. Does anyone know how to echo the ASCII null character?
Thanks,
Alex (3 Replies)
Hi,
I am trying to divide my input to different type of out puts for some other use.
ex: logical_name : jkl00001
expected out put : model=jkl and num=00001
here is the code i actually written
/*******************************************************************/
void... (11 Replies)
I am comparing two multibyte characters in two different platforms having different LC_CTYPE variables, they are returning different values.
One of the variable is sigma initialised to "\317\203"
and the other one is empty string i.e, ""
Below is the scenario of the two platforms:
In... (4 Replies)