In fact thinking about the Regex solution some more, even if there is no Regex 
support using 4D commands you could pipe it through the built-in PHP 
interpreter as there is excellent Regex support in PHP.

Regards,
 
Narinder Chandi,
ToolBox Systems Ltd.
-- 

-----Original Message-----
From: 4D_Tech <[email protected]> on behalf of 4D Tech Mailing List 
<[email protected]>
Reply-To: 4D Tech Mailing List <[email protected]>
Date: Wednesday, 12 June 2019 at 12:46
To: 4D Tech Mailing List <[email protected]>
Cc: Narinder Chandi <[email protected]>
Subject: Re: Emojis in text

    James,
    
    Hi. I encountered a similar problem a while back although the client 
sending the request to MySQL was PHP rather than 4D. My solution was to use 
Regex to replace the emoji characters. Try Googling for something like "remove 
emojis from string" and that should turn up some options you can try out in 4D 
- does 4D have Regex commands now? I didn't check!
    
    Regards,
     
    Narinder Chandi,
    ToolBox Systems Ltd.
    -- 
    
    -----Original Message-----
    From: 4D_Tech <[email protected]> on behalf of 4D Tech Mailing 
List <[email protected]>
    Reply-To: 4D Tech Mailing List <[email protected]>
    Date: Wednesday, 12 June 2019 at 11:59
    To: 4D Tech Mailing List <[email protected]>
    Cc: James Knight <[email protected]>
    Subject: Emojis in text
    
        Hi
        
        I’ve just integrated our system with a review website, importing review 
scores and comments to store in our database.
        
        This is done via a JSON API.
        
        The comments will often include emoticons and unfortunately these choke 
our MySQL implementation (MyConnect plugin) because (I think) it communicates 
using the utf8 charset, whilst MySQL requires utf8mb4 in order to store emojis. 
Attempting to execute a query containing those characters throws a MySQL error.
        
        I’m quite happy to get rid of the emojis, but I cannot see a way of 
stripping these from the text. I’ve tried using ST Get Plain text and JSON 
Stringify, without any luck.
        
        Does anyone know a way of stripping a text field so that it only 
contains regular (UTF8 compatible) characters?
        
        Or does anyone know a way of sending them through MyConnect?
        
        TIA
        
        James
        **********************************************************************
        4D Internet Users Group (4D iNUG)
        Archive:  http://lists.4d.com/archives.html
        Options: https://lists.4d.com/mailman/options/4d_tech
        Unsub:  mailto:[email protected]
        **********************************************************************
    
    
    **********************************************************************
    4D Internet Users Group (4D iNUG)
    Archive:  http://lists.4d.com/archives.html
    Options: https://lists.4d.com/mailman/options/4d_tech
    Unsub:  mailto:[email protected]
    **********************************************************************


**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to