Putting emoji into Datagrids

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Gautami
Posts: 35
Joined: Tue Aug 06, 2013 5:25 am

Putting emoji into Datagrids

Post by Gautami » Mon Aug 26, 2013 11:33 am

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
Attachments
emoji.png
emoji.png (7.56 KiB) Viewed 3949 times

Gautami
Posts: 35
Joined: Tue Aug 06, 2013 5:25 am

Re: Putting emoji into Datagrids

Post by Gautami » Wed Aug 28, 2013 1:15 pm

what an headache.
I suspect that this is something to do with the unicode encodings

:(

MadManSoft
Posts: 36
Joined: Fri Apr 12, 2013 9:15 pm

Re: Putting emoji into Datagrids

Post by MadManSoft » Mon Feb 24, 2014 7:17 pm

Anyone succeed in this?

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Putting emoji into Datagrids

Post by bangkok » Mon Feb 24, 2014 8:09 pm

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.

Post Reply