ASI_强制编码 UTF-8


   请求到数据后有时候显示为乱码,因此在收到请求后我们加了强制转成 utf-8,如下;

+ (void)parseMimeType:(NSString **)mimeType andResponseEncoding:(NSStringEncoding *)stringEncoding fromContentType:(NSString *)contentType

{

    if (!contentType) {

     return;

    }

   

    if ([contentType isKindOfClass:[NSString class]]) {

        if ([contentType hasPrefix:@"application/json"]) {

            contentType = @"application/json;charset=UTF-8";//吉盛项目,强制编码 UTF-8

        }

    }

你可能感兴趣的:(utf-8,ASI_强制编码)