Code:
NSString* string3 = (NSString*)CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)tvQ.text, NULL, (CFStringRef)@":/?#[]@!$&'()*+,;=", kCFStringEncodingUTF8);
My code is working to pass special characters properly via URL to my database, however, if I insert data with linebreaks, it seems to break my app and crashes. Any ideas?
**code was provided to me by user "tc." from a previous question. This is a different issue, so I started a new question.
Figured out the answer:
NSString* encoded = [[string stringByReplacingOccurrencesOfString:@"\n" withString:@" "] stringByReplacingOccurrencesOfString:@"ç" withString:@"c"];
NSString* string3 = [(NSString*)CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)encoded, NULL, (CFStringRef)@":/?#[]@!$&'()*+,;=", kCFStringEncodingUTF8) autorelease];