Internationalization and localization tools


Locale-Sensitive C/C++ String Operation Function

char *strerror(int errnum);

wchar_t *_wcserror(int errnum);

LPTSTR _tcserror(int errnum);

Internationalization (I18n) Function Overview

The strerror function returns a pointer to the system error message corresponding to errnum.

_wcserror is the wide-character version of the function; its parameters and return value are wide characters. _wcserror is supported on Windows platforms only. There is no wide version on ANSI platforms.

_tcserror is the Windows-only Generic version of the function; with the _MBCS or _UNICODE compiler flags determining its mapping to either strerror or _wcserror.

I18n Issues

These functions should not be relied upon to print error messages in any language other than English, and therefore should be avoided in an internationalized application. However, it's worth noting that in some limited instances they still may be useful. For example, for debugging, or for writing to log files that will not be viewed by the end user.

There is no ANSI wide character version of this function. The return from strerror will have to be converted to a wide-character string.

Recommended Function Replacements

Locale-Sensitive C/C++ String Operation Functions

 

Lingoport internationalization and localization services and software