Server returned hard. Storage. Shmedia. Tech / % E6%96% B0% E… SDWebImage cannot load the above link, because the server has encoded Chinese without informing the client, and the client has also done unified encoding, so the loading cannot be caused by two times of encoding. Solution: The client determines whether the URL contains Chinese, and performs encoding if the url contains Chinese. In the code

- (void)setImageUrl:(NSString *)url placeholderImage:(NSString *)imageName { if ([url length] == 0) { self.image = [UIImage imageNamed:imageName]; } if ([url includeChinese]) { url = [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; } // [self sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:imageName] options:SDWebImageLowPriority|SDWebImageRetryFailed|SDWebImageScaleDownLargeImages]; (BOOL)includeChinese {for(int I =0; i< [self length]; i++) { int a =[self characterAtIndex:i]; if( a >0x4e00&& a <0x9fff){ return YES; } } return NO; }Copy the code