Re: convert special characters.
| From: | Karl DeSaulniers | Date: | Thu, 09 Aug 2012 23:08:05 +0000 |
| Subject: | Re: convert special characters. | ||
| References: | 1 2 3 4 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-48399@lists.php.net to get a copy of this message | ||
On Aug 9, 2012, at 5:08 PM, Toby Hart Dyke wrote:
No, I hadn't done that! Ok, this is a good point to start from. Do I set mysql_query("SET character_set_results=utf8", $dbcnx); twice? Thank you guys for your quick responses! Best, Karl DeSaulniers Design Drumm http://designdrumm.com-----Original Message----- From: Karl DeSaulniers [mailto:karl@designdrumm.com] Sent: Thursday, August 09, 2012 10:19 PM To: php-db@lists.php.net Subject: Re: [PHP-DB] convert special characters. On Aug 9, 2012, at 5:41 AM, Karl DeSaulniers wrote:You probably aren't setting your database connection to UTF-8. Try doing this before you do anything with the database, after you have connected: mysql_query("SET character_set_results=utf8", $dbcnx); mb_language('uni'); mb_internal_encoding('UTF-8'); mysql_query("SET character_set_results=utf8", $dbcnx); TobyOn Aug 9, 2012, at 5:37 AM, Karl DeSaulniers wrote:No one? Not even a link I can go look this up myself with? I have successfuly converted before, but this time the company is in the netherlands and their special characters are doing this. Also, I have the database set to UTF-8, but when I check the charset: $charset = mysql_client_encoding($con); it returns latin1? Can someone tell me what I am doing wrong here? Not looking for someone to do it for me. Just some help figuring out which way to look. Why is htmlentities() converting wrong? Hope someone out there can help.Help! How do I get special characters to convert correctly when inserting and reading from my database. For example. é => é ë => ë I keep getting ë and é using htmlentities, htmlspecialchars, etc... Any pointers? Please! Going bald over here. here is my funcitons function stringToMysqlFormat($original_input) {using UTF-8 Karl DeSaulniers Design Drumm http://designdrumm.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php//for inserting the data with special characters INTOmysql$html_encoded =htmlentities(mysql_real_escape_string($original_input));return $html_encoded;} function mysqlToHTMLFormat($encoded) {//for displaying the data FROM mysql $html_decoded =html_entity_decode(stripslashes($encoded));return $html_decoded;} TIA, Karl DeSaulniers Design Drumm http://designdrumm.com