I have added mysql_real_escape_string()
with a query for text inputs. When a user writes text with symbols it passes through mysql_real_escape_string()
and works fine, but when the user pastes text copied from other websites it won't pass through mysql_real_escape_string()
. The text after the apostrophe is cut off.
How can I fix this?
I believe when user pastes text in input field it's not in UTF-8 encoding. Is there any way to process it without errors in core PHP? Also please tell me if you have solutions in Pear DB.