解决AFNetWorking 网络请求,报警告Incorrect NSStringEncoding value 0x8000100 detected

在App进行网络请求的时候,后台老是打印

Incorrect NSStringEncoding value 0x8000100 detected. Assuming NSASCIIStringEncoding. Will stop this compatiblity mapping behavior in the near future.

只需要对进行请求的Url地址做一次转码即可解决,如下:

+ (NSString *_Nullable) encodeURL:(NSString*_Nullable) dString {

NSString *encodedString = (NSString *)
CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
                                                          (CFStringRef)dString,
                                                          NULL,
                                                          nil,
                                                          kCFStringEncodingUTF8));

return encodedString;}

你可能感兴趣的:(解决AFNetWorking 网络请求,报警告Incorrect NSStringEncoding value 0x8000100 detected)