I have built an SMS application that allows users to send from a webpage. The application works great, but I have found an issue that occurs when text is pasted in from another source such as gmail.
Take the following examples:
When typed in manually
INPUT: There's a problem
OUTPUT: There's a problem
When pasted in from gmail
INPUT: There’s a problem
OUTPUT: There?s a problem
I believe that this is caused by the UNICODE ’
not being available in ASCII/UTF-8, but I cannot seem to convert it successfully. Does anyone have recommendations for fixing this with PHP or JS?
I have tried mb_convert_encoding
and iconv
with no luck