I have an HTML form with a standard textarea that is used to leave update notes in text format. Any data saved there is then passed to an SQL database via Ajax where I am basically passing the value of the textarea.
This all works fine but sometimes the saved text then contains symbols like the following where it seems this happens when someone uses certain characters like ‘ , “ or & in the entered text which then adds the following in the database (among the rest of the entered text):
â€à OR “
Is there a way I can prevent this from happening in jQuery, e.g. by using a replace before passing it to the db ? The form is only used by English speakers so no need to cover special characters from other languages but it should work at least with standard text input.
Many thanks for any help with this, Tim.