0

I'm trying to convert emoji to unicode characters. I tried using the second option suggested in this solution: iOS 5: How to convert an Emoji to a unicode character? but my output in my tableviewcell label just looks like this: \ud83d\ude0b Here's the code from saving the comment:

NSData *dataString = [body dataUsingEncoding:NSNonLossyASCIIStringEncoding];
NSString *goodValue = [[NSString alloc] initWithData:dataString encoding:NSUTF8StringEncoding];
NSDictionary *parameters = @{ @"body" : goodValue };
//and so forth it is saved to the cloud

And here's the conversion back to emoji:

NSData *data = [self.comment.body dataUsingEncoding:NSNonLossyASCIIStringEncoding];
NSString *goodValue = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
self.bodyLabel.text = goodValue;
Community
  • 1
  • 1

0 Answers0