Assume I've an array of strings which contain some chinese chars inside. Eg: " This is a sample 在按键 needs to be tested" ^ ^ | | start end
I need to extract only the chinese alone from the char array.
Thanks Vijay
Assume I've an array of strings which contain some chinese chars inside. Eg: " This is a sample 在按键 needs to be tested" ^ ^ | | start end
I need to extract only the chinese alone from the char array.
Thanks Vijay
Pseudo-code (in my gcc world ...sorry, no MS dev access tonight):
wcsncpy(wcDest, wcschr(" This is a sample 在按键 needs to be tested", "在"), 4);
The wcschr() function is the wide-character equivalent of the strchr() function.
From the wcschr() man page:
"It searches the first occurrence of wc in the wide-character string pointed to by wcs."
The wcsncpy() function is the wide-character equivalent of the strncpy().
From the wcsncpy() man page:
"It copies at most n wide characters from the wide-character string pointed to by src, including the terminating null wide character (Laq\0aq), to the array pointed to by dest. Exactly n wide characters are written at dest. If the length wcslen(src) is smaller than n, the remaining wide characters in the array pointed to by dest are filled with null wide characters. If the length wcslen(src) is greater or equal to n, the string pointed to by dest will not be terminated by a null wide character."