Error: Incorrect string value: '\xE2\x80\xAF'

NODE
I am working with an API and occasionally people have imbedded formatting codes into the text of a description which is causing an error when saving to a database field
The field is called description and is of Type ‘Text.’

Occasionally i get an error when doing a database insert like this

I believe hex code E280AF is UTF-8 for “Narrow no-break space”

I have tried to remove it with

description.replace(’\xE2\x80\xAF’, ‘’)
description.replace(‘E280AF’, ‘’)
description.replace(‘xE2x80xAF’, ‘’)

but without any luck, anyone any ideas please

Community Page
Last updated: