Internationalization and localization tools


Locale-Sensitive Windows C++ Functions

LPTSTR lstrcat(LPTSTR lpString1, LPTSTR lpString2);

LPSTR lstrcatA(LPSTR lpString1, LPSTR lpString2);

LPWSTR lstrcatW(LPWSTR lpString1, LPWSTR lpString2);

Internationalization (I18n) Function Overview

The lstrcat function appends lpString2 to the end of lpString1, returning a pointer to the modified string.

lstrcatA is the narrow version of the function; its arguments and return value are single or multibyte strings.

lstrcatW is the wide version of the function; its arguments and return value are wide-character (WCHAR) strings.

I18n Issues

Use the appropriate version of the function as required for internationalization support, ensuring that lpString1 is large enough to hold the combined strings and the terminating null character for the chosen platform. See Locale-Sensitive Length Functions for a discussion on multibyte and wide character sizes.

Recommended Replacements*

Due to the security risks of this function, consider using a safe string function.

If lstrcat is called, use the Generic version of the function rather than explicitly calling the narrow or wide versions. lstrcat will be mapped to lstrcatW when the program is compiled with the #define UNICODE switch, and to lstrcatA otherwise. Using the Generic version facilitates switching between an MBCS and UTF-16 Unicode application.

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 Windows C++ Functions

 

Lingoport internationalization and localization services and software