Internationalization and localization tools


Locale-Sensitive C/C++ String Operation Function

char* _strerror(const char* strErrMsg);

wchar_t* __wcserror(const wchar_t* strErrMsg);

Internationalization (I18n) Function Overview

The _strerror function returns a pointer to an error message string, the contents of which depend on the value of strErrMsg. If strErrMsg is null, then the return is a pointer to a string containing the system error message for the last library call that produced an error (stored in the global variable errno). If strErrMsg is not null, then _strerror returns a pointer to a string containing the passed in string message followed by a colon, a space, the system error message for the last library call producing an error, and a newline character. strErrMessage can be a maximum of 94 characters. To produce accurate results, call _strerror immediately after a library routine returns with an error. Otherwise, errno may be overwritten by subsequent library calls.

__wcserror is the wide character version of _strerror, whose argument and return are wide-character strings.

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 Windows Generic function for _strerror. If migrating to a Windows Generic application, consider using _tperror, which prints error messages to stderr.

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