Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

wctomb(3int) [ultrix man page]

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 Also
       mblen(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 Also
       mblen(3int), mbstowcs(3int), setlocale(3int), wctomb(3int), wcstombs(3int)

																      mbtowc(3int)
Man Page

4 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

sending a null character to a terminal

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)
Discussion started by: vertigo23
3 Replies

2. Programming

Need help in character pointer

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)
Discussion started by: jagan_kalluri
11 Replies

3. Shell Programming and Scripting

Unix character set problem

Hi All, We are getting file into our unix box with multibyte characters. When we tried to view the file the record looks like this Frédéric Actually the data sent to us is Frédéric --> my locale charmap of unix is set to UTF8 only ... but still i am getting this problem. I... (6 Replies)
Discussion started by: sandeeppvk
6 Replies

4. Programming

How will the behaviour of multibyte char differ because of different LC_CTYPE locale?

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)
Discussion started by: baig_1988
4 Replies