1

How should i convert the emojis into unicode and send it to server and then can decode it dynamically.

I can statically give the if condition for perticular emojis.But i want to make it dynamically.

Thanks in advance

ios developer
  • 3,363
  • 3
  • 51
  • 111
  • check this :-http://stackoverflow.com/questions/8635393/ios-5-how-to-convert-an-emoji-to-a-unicode-character and http://stackoverflow.com/questions/14488503/ios-cannot-decode-emoji-unicode-in-json-format-correctly-and-emoji-icons-are-di – Nitin Gohel Mar 11 '13 at 09:53

1 Answers1

-1

few days ago i have same problem. i tried this its work for me :

to pass value to the server

    NSData *data = [textView.text dataUsingEncoding:NSNonLossyASCIIStringEncoding];
    NSString *goodValue = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease];

    goodValue = [goodValue stringByReplacingOccurrencesOfString:@"\\" withString:@"\\\\"];

when fetch value from the server

    NSString *goodValue = [StaticClass urlDecode:[dataDict objectForKey:@"comment_text"]];
    NSData *newdata=[goodValue dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];
    NSString *mystring=[[NSString alloc] initWithData:newdata encoding:NSNonLossyASCIIStringEncoding];
SAMIR RATHOD
  • 3,512
  • 1
  • 20
  • 45