I am using jQuery editor with PHP it works fine for plane text (text with out special characters) but if I try to post text which contain special characters then it does not store these special characters in to db table.. and when I tried to replace any special character with HTML codes it works fine. But it is too difficult to replace all special character one by one.. Is there any script which replace all special characters from a string...?
-
You have an encoding issue that can be fixed. – Pekka Oct 29 '10 at 08:30
-
What is your database and script encoding? – jwueller Oct 29 '10 at 08:39
2 Answers
Do you mean something like PHP's str_replace()?
http://php.net/manual/en/function.str-replace.php

- 746
- 7
- 14
Is there any script which replace all special characters from a string...?
This is the wrong approach. You need to get your character sets right, so will be no need to replace anything.
I don't know what you're doing, but if you are transmitting data through Ajax, it is probably UTF-8 encoded. If your database is in a different character set, you may need to convert it.
Basic (deep) reading: The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)
For more specific information, you will need to provide more details about your situation. Here are a few questions that deal with the subject, maybe one of them already helps: