COMFIED 27 Report post Posted January 11 I am storing and retrieving emoji in UTF16 format on a MySQL database. When I retrieve, i get the data results "\ud83d\ude0a" for smile emoji (😊) "\ud83e\udd37\u200d\u2640" (for🤷♀️) Is there a simple way to convert the UTF16 to unicode and render the emoji on a browser? Share this post Link to post Share on other sites
jarto 430 Report post Posted January 11 Phew, that took some digging, but I found a solution: function ConvertFromUCS16(Value: String): String; begin //Make sure any " are escaped for var i:=Length(Value) downto 1 do if (Value[i]='"') and ((i=1) or (Value[i-1]<>'\')) then Insert('\',Value,i); result:=TString.DecodeURIComponent(JSON.parse('"'+Value+'"')); end; Solution from: https://stackoverflow.com/questions/7885096/how-do-i-decode-a-string-with-escaped-unicode Edit: Whoops, fixed a bug in the escaping Edit2: Add System.JSON to uses clause. 2 IElite and lynkfs reacted to this Share this post Link to post Share on other sites
COMFIED 27 Report post Posted January 12 IT WORKS - Thanks!!! Share this post Link to post Share on other sites