Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mbstowcs(3int) [ultrix man page]

mbstowcs(3int)															    mbstowcs(3int)

Name
       mbstowcs - converts a sequence of multibyte characters into a sequence of characters of type wchar_t.

Syntax
       #include <stdlib.h>)

       size_t mbstowcs (pwcs, s, n)
       wchar_t *pwcs;
       const char *s;
       size_t n;

Arguments
       pwcs    The pwcs argument is a pointer to the resulting wide character string.

       s       The s argument is a pointer to the multibyte character sequence.

       n       The n argument is the maximum number of resulting wide characters stored in pwcs.

Description
       The  function converts a sequence of multibyte characters from the array pointed to by s into a sequence of characters of type wchar_t, and
       stores not more than n characters into the array pointed to by pwcs. No multibyte characters that follow a null character  (which  is  con-
       verted  into a code with value zero) are examined or converted. No more than n elements are modified in the array pointed to by pwcs.  This
       function is affected by the LC_CTYPE category of the current locale.

Return Values
       If an invalid multibyte character is encountered, the function returns (size_t) -1.  Otherwise, the function returns the  number  of  array
       elements modified, not including a terminating null character, if any. The array will not be null-terminated if the value returned is n.

See Also
       mblen(3int), mbtowc(3int), setlocale(3int), wctomb(3int), wcstombs(3int)

																    mbstowcs(3int)

Check Out this Related 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)
Man Page

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to declare an array to take more than 10,000 characters

Hi Guys Need some help I am reading the string values from the text files into the shell script and had them feed into array I have declared an associative array as TYPE t_user_id_tab IS TABLE OF VARCHAR2(3000);\n my_user_id t_user_id_tab;\n varchar2 is limiting me to take only... (0 Replies)
Discussion started by: pinky
0 Replies

2. 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

3. 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

4. Shell Programming and Scripting

Patterns with egrep/sed/awk?

I have an array with characters, what I want is if there are other characters in the array which I am looking for than take action that is print BAD ARRAY. So far my code just finds characters but instead I want that it should look for other characters. echo "A B C D F" | egrep -o "D | F" O/P... (5 Replies)
Discussion started by: dixits
5 Replies

5. Linux

Issue in inserting null string in array

I am getting some values from a file and putting them in an array..but the null strings are not getting passed to the array. So during printing the elements ,the null string is not showing in the output. during array size calculation it is also excluding null.Please let me know how to do it. # cat... (2 Replies)
Discussion started by: millan
2 Replies