According to I create a chat application and i use ajax to send message to PHP and I have a problem about special character
If user input sing quote and double quote, the ajax will error and can't send to PHPformdata.append('chat_message', escape($('#chat_message').val()));
I tried to add escape function then it's work, ajax can send to PHP but when PHP show message very strange as this picture

My question is How can I send the special character without escape?
Or Should I fix this problem on PHP part by convert the special code char back to string?