Internationalization and localization tools


String Format Function

int vprintf(const char *format, va_list argptr);

int vwprintf(const wchar_t *format , va_list argptr);

int _vtprintf(const TCHAR *format, va_list argptr);

Internationalization (I18n) Function Overview

The vprintf function formats a null-terminated string, using the format argument and the data pointed to by the argptr argument, and outputs it to stdout. The number of single-byte characters written is returned, or -1 if an error occurs.

vwprintf is the wide character version and returns the number of wide characters written.

_vtprintf is the Windows-only Generic version of the function; with the _MBCS or _UNICODE compiler flags determining its mapping to either vprintf or vwprintf.

I18n Issues

Use the appropriate version of the function as required for internationalization support, noting the following:

Prior to calling one of these functions, ensure that the current locale is set properly by calling setlocale, as string formatting is dependent on the LC_NUMERIC locale category. See String Formatting in C and C++ for a discussion on locale-sensitive formatting in internationalized applications.

Recommended Replacements*

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

String Format Functions

 

Lingoport internationalization and localization services and software