Internationalization and localization tools


Locale-Sensitive C/C++ String Operation Function

char *strrchr(const char *string, int c);

char *rindex(const char *string, int c);

wchar_t *wcsrchr(const wchar_t *string, wchar_t c);

unsigned char *_mbsrchr(unsigned char *string, unsigned int c);

_TXCHAR *_tcsrchr(_TXCHAR *string, _TINT c);

Internationalization (I18n) Function Overview

The strrchr function returns a pointer to the last occurrence of c in string, or NULL if c is not found.

wcsrchr is the wide version of the function; its parameters and return are wide character strings.

_mbsrchr is supported only on Windows platforms and is the multibyte version of the function; its parameters and return are multibyte character strings.

_tcsrchr is the Windows-only Generic version of strrchr; with the _MBCS or _UNICODE compiler flags determining its mapping to either _mbsrchr or wcsrchr.

The rindex function is the BSD name for strrchr. Use strrchr instead.

I18n Issues

Use the appropriate version of the function as required for internationalization support.

For Windows MBCS platforms, ensure that the multibyte code page is set properly, as _mbsrchr depends on it. By default, the multibyte code page is set to the system-default ANSI code page obtained from the operating system at program startup. Use _getmbcp and _setmbcp to query or change the current multibyte code page, respectively.

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