The Details
I have a simple textarea <textarea></textarea>
The value of this textarea is sent through ajax and stored in a database.
The value in this database is viewed on an iPad (or iPad mini or iPhone, etc)
The Problem
When someone copies text from somewhere (could be anywhere from the internet potentially), I want to remove any weird characters such as: “windows-1252 quotes”
from the text before storing them in a utf8_unicode_ci
column in a database. This column stores the above quotes but are unknown on certain devices (like iPad)
The Question
How can I remove these characters in Javascript
or PHP
?
string.replace
has been tried from various examples to remove these characters.
htmlentities($sample)
has been tried in order to convert these characters but still no luck.
Any help would be appreciated! Thanks!