很简单的一句话搞定(在进行get请求或者post请求时,遇到中文字符参数,进行转码!)
这是ios9之前的写法!
NSString *ss = @"cdcdc多好吃的吃的吃的";
ss = [ss stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
这是9之后的写法
ss = [ss stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];