atoi() does not work to to convert UTF-8 string to integer on Linux
Hello,
I need to read a number from a .txt file which is in UTF-8 format.
In my program I'm reading this number as a string from .txt file.
Then using atoi() to convert it to integer. But for any number atoi() is giving output as 0.
I understand that in Linux default encoding format is UTF-8 and according to information I received from google search atoi() should work in this case.
Is there any way to make this work? or any other way or logic to convert UTF-8 string(which is always going to consist numbers in my case)to integer.
|