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