| Showing entries 1 to 4 |
A recent question on a mailing list was the best practices for UTF-8 and PHP/MySQL. The following are the configurations I used in my multi-language projects.
# my.cnf [mysqld] default_character_set = utf8 character_set_client = utf8 character_set_server = utf8 [client] default_character_set = utf8
#php.ini default_charset = "utf-8"
#httpd.conf
AddDefaultCharset UTF-8
<VirtualHost>
AddCharset UTF-8 .htm
</VirtualHost>
<meta charset="utf-8">
header('Content-type: text/html; charset=UTF-8');
SET NAMES utf8;
And last
[Read more...]The MySQL database (http://www.mysql.com/) v4.0.23 is using the default character set of “Latin1″. When the database was created I had no knowledge of character sets other wise it would have been “UTF-8″.
The web pages are using a character set of “UTF-8″.
Data being queried from a MySQL database (http://www.mysql.com/) that contains French accent characters will not render correctly in the browser even after applying PHP htmlentities().
Example code: $string = htmlentities($string , ENT_QUOTES, “UTF-8″);
The queried data from the database was inputted using the
[Read more...]| Showing entries 1 to 4 |