Internationalization and localization tools


Locale-Sensitive C/C++ String Operation Function

char *strcpy(char *strDestination, const char *strSource);
errno_t strcpy_s(char *strDestination, size_t numberOfElements, const char *strSource);
errno_t strcpy_s(char (&strDestination)[size], const char *strSource);

wchar_t *wcscpy(wchar_t *strDestination, const wchar_t *strSource);
errno_t wcscpy_s(wchar_t *strDestination, size_t numberOfElements, const wchar_t *strSource);
errno_t wcscpy_s(wchar_t (&strDestination)[size], const wchar_t *strSource);

unsigned char *_mbscpy(unsigned char *strDestination, const unsigned char *strSource);
errno_t _mbscpy_s(unsigned char *strDestination, size_t numberOfElements, const unsigned char *strSource);
errno_t _mbscpy_s(unsigned char (&strDestination)[size], const unsigned char *strSource);

_TXCHAR *_tcscpy(_TXCHAR *strDestination, const _TXCHAR *strSource);
errno_t _tcscpy_s(_TXCHAR *strDestination, size_t numberOfEmenents, const _TXCHAR *strSource);
errno_t _tcscpy_s(_TXCHAR (&strDestination)[size], const _TXCHAR *strSource);

_TXCHAR *_ftcscpy(_TXCHAR *strDestination, const _TXCHAR *strSource);

Internationalization (I18n) Function Overview

The strcpy function copies strSource, including the ending null terminator, to strDestination, and returns a pointer to strDestination.

wcscpy is the wide character version of strcpy; its arguments and return are wide-character strings.

Supported on Windows platforms only, _mbscpy is the multibyte version of strcpy, supporting multibyte strings for the arguments and return.

_tcscpy and _ftcscpy are Windows-only Generic versions of the function.

Supported on Windows platforms only, strcpy_s, wcscpy_s, _mbscpy_s, and _tcscpy_s are secure versions of their counterparts. For details, click here.

I18n Issues

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

Recommended Replacements*

On Windows platforms, a more secure string function should be used. On ANSI platforms, call the safer strncpy function, if possible. These are shown as the first choices in the following table:

*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