title: Encode Emoji to string
body: <p>I want to encode this emoji  to string:</p>
  
  <p>I have tried like this:</p>
  
  <pre><code>let data = self.comment.dataUsingEncoding(NSNonLossyASCIIStringEncoding, allowLossyConversion: true)
  if let data = data {
     let emojiString = NSString(data: data, encoding: NSUTF8StringEncoding) as! String
         self.comment = emojiString
  }
  </code></pre>
  
  <p>but it doesn't work.</p>
  
  <p><a href="https://i.stack.imgur.com/7VOA2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7VOA2.png" alt="enter image description here"></a></p>
  
  <p>I want to encode like <code>&amp;#128520;</code> , not <code>\ud83d\ude08</code></p>
  
  <p>So how to do this?</p>