title: How to encode emoji while sending to server (Ruby on Rails)?
body: <p>While I am sending the emoji to server "\ud83d\ude0e" (emoji unicode) in the given format, the server could not understand the code and while sending push notification from server to device, the notification is not coming.</p>
  
  <p>I have used :</p>
  
  <pre><code>NSData *data = [self.activeTextField.text dataUsingEncoding:NSNonLossyASCIIStringEncoding];
  NSString *goodValue = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
  </code></pre>
  
  <p>to encode the message(emoji) while sending and used:</p>
  
  <pre><code>NSData *data = [strReceivedMsg dataUsingEncoding:NSUTF8StringEncoding];
  NSString *goodValue = [[NSString alloc] initWithData:data encoding:NSNonLossyASCIIStringEncoding];
  </code></pre>
  
  <p>while receiving the messages.</p>
  
  <p>Please suggest how to resolve this issue</p>
  
  <p>Thanks</p>