Convert UTF-8 encoded NSData to NSString,转载自stackoverflow
If the data is not null-terminated, you should use -initWithData:encoding: NSString* newStr = initWithData:theData encoding:NSUTF8StringEncoding];
If the data is null-terminated, you should instead use -stringWithUTF8String: to avoid the extra \0 at the end. NSString* newStr = ];
转载地址:http://stackoverflow.com/questions/2467844/convert-utf-8-encoded-nsdata-to-nsstring/2467856#2467856