title: Swift Encode/decode emojis
body: <p>I'm trying to encode and decode Emojis to send them to my database.</p>
  
  <p>I use this to encode:</p>
  
  <pre><code>var comentario = String()
  let data = Comment.data(using: String.Encoding.nonLossyASCII, allowLossyConversion: true)
  if let data = data {
      let emojiString = NSString(data: data, encoding: String.Encoding.utf8.rawValue)! as String
      comentario = emojiString
  }
  </code></pre>
  
  <p>And it works. But now I don't know how to decode the emoji.</p>
  
  <p>This is the type of encode --->  \ud83d\ude1a</p>