How to remove emoji's from unicode string

Kee Nethery kee.nethery at elloco.com
Mon Jan 14 00:51:35 CET 2019


On my phone so verify this.
Shouldn’t you be using codepointoffset(),not offset()?

Kee Nethery

> On Jan 13, 2019, at 1:34 PM, Richmond via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Cop a look at this:
> 
> *http://forums.livecode.com/viewtopic.php?f=7&t=32030*
> 
>> On 13.01.19 22:17, Stephen MacLean via use-livecode wrote:
>> Hi All,
>> 
>> The recent conversations on using offset() with Unicode strings was very enlightening, thanks to all that took part!.
>> 
>> I have data stored in UTF8mb4. I use textDecode after loading it from the DB to put it into a format that LC understands. I then use offset() to find certain tags, text, etc. to work with. However, if there are emoji in that string, the offset() function hard crashes with a out of range error.
>> 
>> Due to the troubles offset(), I’m looking for a way to remove the emojis before I have to use the offset function.
>> 
>> Short of compiling a list of emoji and the decimal equivalent, does anyone have a way to do this in LC?
>> 
>> My offset code has been rock solid, except for these rare instances were there are emoji in the text and I am not really looking to change it if I don’t have to, preferring to just remove the emoji if possible.
>> 
>> TIA,
>> 
>> 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