I am working on a internationalization project. Do other languages, such as Arabic or Chinese, use different representations for digits besides 0-9? If so, are there versions of atoi() that will account for these other representations?
I should add that I am mainly concerned with parsing input from the user. If the users types in some other representation I want to be sure that I recognize it as a number and treat it accordingly.
I may use
std::wistringstream
and locale to generate this integer.More info on stream class and on locale class.
If you are concerned about international characters, then you need to ensure you use an "Unicode-aware" function such as _wtoi(..).
You can also check if UNICODE is supported to make it type independent (from MSDN):