Can someone provide a regular expression to search and replace illegal characters found
Example, removing �
I am not sure how many types of ‘illegal’ characters exist but I think this will be a good start.
Many thanks
edit – I have no control over the data, we’re trying to create a catch for the potentially bad data we’re receiving.
Invalid characters get converted to 0xFFFD on parsing, so any invalid character codes would get replaced with:
You can get all types of invalid sorts of chars here