汉字与utf8相互转化
NSString* strA = [@"%E6%B5%8B%E8%AF%95%E6%A0%87%E9%A2%98"stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString *strB = [@"测试标题"stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString 转化为utf8
NSString *strings = [NSStringstringWithFormat:@"abc"];
NSLog(@"strings : %@",strings);
CF_EXPORT
CFStringRef CFURLCreateStringByAddingPercentEscapes(CFAllocatorRef allocator,CFStringReforiginalString,CFStringRef charactersToLeaved, CFStringReflegalURLCharactersToBeEscaped,CFStringEncoding encoding);
NSString *encodedValue = (__bridge NSString*)CFURLCreateStringByAddingPercentEscapes(nil, (__bridgeCFStringRef)strings,nil, (CFStringRef)@"!*'();:@&=+$,/?%#[]",kCFStringEncodingUTF8);