Database data & emoji's
Stephen MacLean
smaclean at madmansoft.com
Tue Aug 14 22:07:41 EDT 2018
Hi Tore,
Thanks, but I’ve already looked at and tried those.
Even putting the data directly from the RecordSet to the field just results in question marks “?” where the emoji should be:
put textDecode(revDatabaseColumnNamed(sRecSet,"tw_full_text")) into fld "cleaned_tw_content" of cd “twCleaner"
The table and field in the table are utf8mb4 encoded to allow the storing of emoji and other UTF data.
My connection in Navicat show it to be UTF-8 as well, and I can see the emoji in the results. However, I don’t see an option to set this in the revOpenDatabase(), so I take it that LC does it automatically…
Any other ideas appreciated.
TIA,
Steve MacLean
> On Aug 14, 2018, at 6:24 PM, Tore Nilsen via use-livecode <use-livecode at lists.runrev.com> wrote:
>
> You should look up textEncode and textDecode in the dictionary. I think they may prove useful.
>
> Best regards
> Tore Nilsen
>
> -------
> This mail contains no viruses or bacteria as it is electronically produced and untouched by human hands. Once printed it may or may not contain various microorganisms that can cause diseases. Print and hand out at own risk. Unsolicited distribution of this mail is prohibited.
>
>
>
>
>
>
>
>> 15. aug. 2018 kl. 00:18 skrev Stephen MacLean via use-livecode <use-livecode at lists.runrev.com>:
>>
>> Hi All,
>>
>> So I have data (text) stored in a mySQL DB that is set for UTF8 and it stores unicode and emoji characters just fine.
>>
>> My problem is that when I pull a field from the record set and put it into a LC field, I don’t get the unicode or emoji, just the the usual strange characters.
>>
>> I know that LC fields support emoji and other unicode characters. I can cut and paste them in and they display fine.
>>
>> My steps in getting the data from the DB to a LC field are:
>>
>> Load the data into an array element like:
>> put revDatabaseColumnNamed(sRecSet,"tw_full_text") into gCurrentRec["tw_full_text"]
>>
>> Then:
>>
>> put gCurrentRec["tw_full_text"] into fld "tw_full_text"
>>
>>
>> I’m probably missing some encoding or decoding step along the way… can some one point me in the right direction?
>>
>> Thanks,
>>
>> Steve MacLean
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list