我正在使用此代码片段对字符进行编码,以便对 POST 请求友好:
NSString *unescaped = [textField text];
NSString *escapedString = (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(
NULL,
(__bridge_retained CFStringRef)unescaped,
NULL,
(CFStringRef)@"!*'();:@&=+$,/?%#[]",
kCFStringEncodingUTF8);
效果很好,但不添加转义引号:"
如何在IOS中转义引号?