I have a Data Extension named "Jobs", where I keep records from dataview Job. My team started to use emojis in subject lines of the e-mails, so also in my table "Jobs", I have those emojis, e.g. 😍, 💵, 😎.
I have also another system, which retrieves data from my table "Jobs", using SOAP API. Unfortunately, this tool cannot handle emojis and entire process is failing. I cannot modify this another system, so I want to delete those emojis from my data. But I don't know how to do that.
Using following query:
SELECT
UNICODE(SUBSTRING(Subject, 1, 1)) AS Char_first,
UNICODE(SUBSTRING(Subject, 2, 1)) AS Char_second
FROM Jobs
I was able to check, that e.g. when this emoji 😍 is at the beginning fo the subject, the first Unicode code is 55357 and the second one is 56845. So I tried folowing queries:
SELECT
Subject,
REPLACE(Subject, CHAR(55357), '') AS cleaned_subject,
FROM Jobs
SELECT
Subject,
REPLACE(Subject, CHAR(55357) + CHAR(56845), '') AS cleaned_subject,
FROM Jobs
SELECT
Subject,
REPLACE(TRIM(Subject), CHAR(55357) + CHAR(56845), '') AS cleaned_subject,
FROM Jobs
But none of them works correctly. Always column "Subject" is correctly retrieved, but column "cleaned_subject" is always empty.