It is unusual for a Linux program to use the wchar_t type.
The reason is that Linux uses utf-8 as standard encoding. char const* strings are considered utf-8 glibc strings. Ascii characters and utf-8 digits have the same byte representation, so atoi () works with both ascii and utf-8 strings.
Having said that, look at #include <wchar.t> , it provides wcstol() .
source share