Internationalization and localization tools


Locale-Sensitive C/C++ String Operation Function

int atoi(const char* string);

int _wtoi(const wchar_t* string);

int _tstoi(const TCHAR* string);

int _ttoi(const TCHAR* string);

Internationalization (I18n) Function Overview

The atoi function converts string into an integer, using the LC_NUMERIC category setting of the current locale.

_wtoi is supported only on Windows platforms and is the wide character version of atoi, converting a wide-character string into an integer.

_tstoi and _ttoi are Windows-only Generic versions of the function.

I18n Issues

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

For ANSI UTF-8, atoi is considered obsolete and strtol should be called instead.

For ANSI UTF-16, use wcstol.

Ensure that the current locale is set properly.

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