my orginal text is 1 1/2"w x 1/2"h , but in database it look likes 1 1/2â€w x 1/2â€h.
I am using stripslashes().
But still i can’t convert the encrypted string.
Thank You all
i just added to html.
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
I don’t know where you read you have to use
stripslashes()to escape database input or output but that information is wrong. You always have to use the specific escaping mechanism provided by your database library. For instance, if you are using PDO you can use bindValue() to inject values into your SQL code.As about
1 1/2â€w x 1/2â€h, that looks like a multi-byte UTF-8 string misinterpreted as some single-byte encoding (possibly ISO-8859-1). It looks like you are either trying to fit UTF-8 data into a Latin1 database or providing a wrong charset when connecting to the database. In the first case, the best solution is changing your DB charset to match your application’s charset (if your DBMS allows to do so). In the second case, you’ll probably find the solution in the PHP manual page for whatever your DB library is: look for some method to specify the charset or encoding of the connection.