Internationalization and localization tools


Locale-Sensitive C/C++ String Operation Function

long atol(const char* string);

long _wtol(const wchar_t* string);

long _tstol(const TCHAR* string);

long _ttol(const TCHAR* string);

Internationalization (I18n) Function Overview

The atol function converts string into a long, using the LC_NUMERIC category setting of the current locale.

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

_tstol and _ttol are the Windows-only Generic version of the function.

I18n Issues

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

For ANSI UTF-8, atol 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