I had the same problem after digging for hours and finally finding this answer that works for me
If you use rails as your server, thatβs all you need to do. No need to do anything in ios / xcode, just pass the NSString without using any UTF8 / 16 encoding files on the server.
Postegre saves the code correctly, it's just when you send the json response back to your ios client, assuming you are rendering json: @message, the json encoding problem has problems.
you can check if you have a problem with json coding in the rails console by performing the simplicity of the test in the console test = {"smiley" => "u {1f604}"} test.to_json
if it prints "{\" smiley \ ": \" \ uf604 \ "}" (note that 1 is lost), then you have this problem. and the fix from the link will fix it.
source share