Re: utf-8 in mysql but not outputting as utf-8 on web
| From: | Kenneth Andresen | Date: | Fri, 23 Dec 2005 03:16:13 +0000 |
| Subject: | Re: utf-8 in mysql but not outputting as utf-8 on web | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-227828@lists.php.net to get a copy of this message | ||
Hello,
why not simply convert the text to html
mb_convert_encoding($string, 'html', 'utf-8');
Best regards,
Kenneth
jonathan wrote:
I'm inserting some info into a mysql table which has the charset set to utf-8. When I do a select via the command-line from mysql, it looks like this: Clams and mussels with Dijon-crème fraîche-saffron sauce assuming this is coming out in your email client ok, it should look good. On a web page, I set the charset to utf-8 via: header("Content-type: text/html; encoding: UTF-8"); as the top-line I then do a select for this field and it outputs like this in the browser: Clams and mussels with Dijon-crème fraîche-saffron sauce I'm familiar with html encoding. As this is going to go to XML, I wanted to see if I could keep it in the native format. Am I doing something wrong on the web side why I won't display this correctly? Is there some Apache config I need to be aware of? thanks, jonathan