I’m trying to parse an “Arabic text” from an HTML page to one of my labels in my app. I’m using Ben Reeves’ HTML Parser.
I’ve succeeded to parse the line, however, the line was completely unreadable. Something like this “ÙØªØ¯Ùات اÙÙØ§Ø¯Ø§ÙÙ Ù”
After some checkup I think my problem is in one of these 4 lines. (I wrote them to download the page content)
NSString *googleString = @"http://x1q.com/alf_news_app.html";
NSURL *googleURL = [NSURL URLWithString:googleString];
NSError *errorss;
NSString *googlePage = [NSString stringWithContentsOfURL:googleURL
encoding:NSASCIIStringEncoding
error:&errorss];
I understand that UILabel show exactly what it has with no change. And I bit that I have to decode something to get the readable text. Though, I have no idea how.
Your help is appreciated.
Note: Not very experienced in Obj-C
The page that you are downloading uses UTF-8 encoding, so instead of
NSASCIIStringEncoding, useNSUTF8StringEncoding.I.E. change the last line to: