Re: convert special characters.
| From: | Karl DeSaulniers | Date: | Fri, 10 Aug 2012 02:08:13 +0000 |
| Subject: | Re: convert special characters. | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-48405@lists.php.net to get a copy of this message | ||
On Aug 9, 2012, at 8:20 PM, Govinda wrote:
That is a good point. I will try that and see. Karl DeSaulniers Design Drumm http://designdrumm.comThey are getting converted in those functions I posted. They display correctly when in the text field, but when inserted to the DB by that functions, they get converted. Then when I echo them out of the DB they are the converted chars. I think it may be the table or table cell, but I read somewhere on php.net that hemlentities doesn't always convert correctly. Hence my asking of this question.notice that htmlentities() has several params... incl. one for the charset: http://us.php.net/manual/en/function.htmlentities.php But now that I re-read your OP, I am thinking, WHY are you saving the data entity-ized at all? My understanding has always been to save the data just *as it is*.. and if you LATER need to entity-ize it (for example: for display on a webpage), then do that at the time you pull the data out of the db for display. Of course this would require your db/table/connection are all of a charset that can handle the characters you are asking it to save into the db. I have a UTF-8 db that saves content in dozens of languages... and it works fine.. and none of the data has been messed with at all from what the language-specific user input. -Govinda -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php