How to prepare an NSURL from an NSString continaing international characters?
问题 I have to access a web server using a GET with international characters (Hebrew in my case but could be anything). So I make an NSString just fine but [NSURL URLWithString:urlString]; // returns nil. I realize I probably have to convert the international characters to percent codes. Is there a built in method in Objective-c to do so? 回答1: Yes there is, you need -stringByAddingPercentEscapesUsingEncoding: method: [NSURL URLWithString:[string stringByAddingPercentEscapesUsingEncoding