I found the solution, and it was with NSURLComponents
- at this point a completely undocumented class added in iOS7.
NSURLComponents *components = [NSURLComponents new];
components.scheme = @"http";
components.host = @"myurl.com";
components.path = [NSString stringWithFormat:@"%@/mypath/%@", @"/mobile_dev/api", user_id];
components.percentEncodedQuery = [NSString stringWithFormat:@"name=%@", [term urlEncodeUsingEncoding:NSUTF8StringEncoding]];
NSURL *fullURL = [components URL];
By using components.percentEncodedQuery
, the term
element uses the encoding I put on it, and apple doesn't touch it.
Hopefully this helps someone else.