I was scraping a page, and I tried to convert some text from page to int, but I got
input string was not in correct format
text is not in English: "۲۳"
But the page codepage is Utf8
At first I tried, int.parse, Convert.ToInt32. No luck, then
byte[] bytes = Encoding.UTF8.GetBytes(eventTime);
var bytDestination = Encoding.Convert(Encoding.UTF8, Encoding.Unicode, bytes);
var resultString = Encoding.Unicode.GetString(bytDestination);
no luck,Same error, (i tried other codepages , like "Default" , "ASCII")
I checked with:
char.IsDigit(eventTimeHourMinue[0]);
char.IsDigit(eventTimeHourMinue[1]);
Noth return true.
How should I Convert this string to int?