Having quite a bit of trouble dealing with special characters being sent in an AJAX request at the moment.
This is an example of the XML body being sent:
<updateUnitComments><studentID>1234</studentID><qualID>123</qualID><unitID>123</unitID><comments>comments go here</comments></updateUnitComments>
(The request is sent with UTF-8 encoding btw)
However, if there is something like an ampersand or a less than or greater than symbol in the comments (which there could easily be, as it's from a textarea), it doesn't work.
Now I've been through loads of google links on the matter and tried pretty much everything I can find, including:
- wrapping the comments in CDATA
- manually replacing the symbols with something else
- Converting & to &
But even when converting an & to something like %26 or whatever it's code is, it still doesn't work, so I'm quite confused