NSString *room_name = @"我是谁我是谁";
UInt8 buff_name[1024];
memcpy(buff_name, [room_name UTF8String],[room_name lengthOfBytesUsingEncoding:NSUTF8StringEncoding] + 1);
//|UTF8String|返回是包含\0的 |lengthOfBytesUsingEncoding|计算不包括\0 所以这里加上一
printf("%s", (char *)buff_name);
NSString *result = [NSString stringWithCString:(char *)buff_name encoding:NSUTF8StringEncoding];
NSLog(@"%@", result);