Page 1 of 1

Putting emoji into Datagrids

Posted: Mon Aug 26, 2013 11:33 am
by Gautami
Hi ALL,
Thank you for all the help so far.
This forum is the best :mrgreen:

So now, I have a emoji problem.
I have taken out some data from an sql db and stored them on a dg.
However this data contains some emoticons, which when viewed in the dg, it looks
like as displayed in the attached picture.

I have been some codes in python that goes like this:
newtext = newtext.replace(u'\U0001F0CF', '<img src="data/emoji_new/1F0CF.png" alt=""/>')

It says to replace a certain code with the other, the problem is how do i get the initial eg. "U0001F0CF" code from the characters??

Thank you in advance for any help rendered!

Gautami

Re: Putting emoji into Datagrids

Posted: Wed Aug 28, 2013 1:15 pm
by Gautami
what an headache.
I suspect that this is something to do with the unicode encodings

:(

Re: Putting emoji into Datagrids

Posted: Mon Feb 24, 2014 7:17 pm
by MadManSoft
Anyone succeed in this?

Re: Putting emoji into Datagrids

Posted: Mon Feb 24, 2014 8:09 pm
by bangkok
What is the encoding you use in the SQL database ?

UTF8 ?

If yes then, you have to change the default behavior of your datagrid, following this lesson

http://lessons.runrev.com/s/lessons/m/d ... -to-a-cell

Then, in the script replace FillInData with :

Code: Select all

on FillInData pData
   set the unicodetext of the long ID of me to uniencode(pData, "utf8")
end FillInData
This will allow your datagrid to display correctly UTF8 characters, coming from your DB.