Actually Iam trying to create NSUrl From string which comprises of english as well as arabic words with spaces.but the NSURl returns null after passing this to nsurl. what should i do to get this done.
Asked
Active
Viewed 522 times
2 Answers
2
you should do like this: second line is important.
NSString *urlstr=[NSString stringWithFormat:@"www.ModelAirplane.ir/هاشم"];
urlstr = [urlstr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL * url=[NSURL URLWithString:urlstr];
NSLog(@"%@",url.description);

Hashem Aboonajmi
- 13,077
- 8
- 66
- 75