iOS中ASCII字符串转UTF8格式
iOS中ASCII字符串转UTF8格式,可调用下面这个方法:
-(NSString *)gb2312toutf8:(NSData *) data
{
NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);
NSString *retStr = [[NSString alloc] initWithData:data encoding:enc];
return retStr;
}