Internationalization and localization tools


Locale-Sensitive C/C++ String Operation Function

void *memmem(const void *haystack, size_t haystack-len, const void *needle, size_t needle-len);

Internationalization (I18n) Function Overview

The function memmem is like strstr, but needle and haystack are byte arrays rather than null-terminated strings. needle-len is the length of needle and haystack-len is the length of haystack.

I18n Issues

Special care must be taken with the needle-len and haystack-len size parameters. See Locale-Sensitive Length Functions for a complete discussion of the issues involved with functions that pass length parameters.

There is no ANSI wide character version of this function. One option is to implement your own function. Another is to convert your logic to temporarily null terminate the strings involved and then use wcsstr. After the call you will have to replace the null character with the byte that was originally there.

Recommended Replacements*

*If you're already using the recommended function, see I18n Issues for other reasons why Globalyzer is detecting the function.

Locale-Sensitive C/C++ String Operation Functions

 

Lingoport internationalization and localization services and software