I'm using javascript to post data from a form to a PHP script (using the Spry AJAX library). I'm using encodeURIComponent(textfieldName) to encode the data before posting so that the post works.
The problem I'm having is that if the data contains special characters like an apostrophe, the data received by the PHP script contains unicode-like junk like this: %u2019. If I leave off the encodeURIComponent(), though, text_code doesn't get sent properly. (It gets broken into several different post variables.)
So, my question is: Is there a different way to have javascript escape or convert my user input string or, failing that, to have the "receiving" PHP script convert it back?