How to convert hex value to emoji icons, I have a line as below
NSString *myVal = @"1F61E";
how can i convert this text to display it as emoji charrcaters?
I found that the value from this link Please let me know, I am really stuck in this problem.
Updated
NSString *utf8String1 = @"1F61E"; NSString *a = [self convert:utf8String1]; NSLog(@"%@ &&&&&&&&&&&&&&&&&&&&&",a); -(NSString*)convert:(NSString*)decoded{ unichar unicodeValue = (unichar) strtol([decoded UTF8String], NULL, 16); char buffer[2]; int len = 1; if (unicodeValue > 127) { buffer[0] = (unicodeValue >> 8) & (1 << 8) - 1; buffer[1] = unicodeValue & (1 << 8) - 1; len = 2; } else { buffer[0] = unicodeValue; } return [[NSString alloc] initWithBytes:buffer length:len encoding:NSUTF8StringEncoding]; }
source share