I can't get PHP to read/output utf8 text from MySQL.
[tt]Setup - win32, MySQL 5.1.30, PHP 5.2.8[/tt]
My table is created like this:
A sample row-dump from the MySQL prompt, with special characters (Danish, in this case) looks correct, like this:
So far, so good. However, when I fetch the [tt]html[/tt] field from this row and output it with PHP I get only;
I output from PHP with utf8 encoding set in my xhtml head block:
Stars, free drinks and eternal gratitude in exchange for advice
Thanks
[tt]Setup - win32, MySQL 5.1.30, PHP 5.2.8[/tt]
My table is created like this:
Code:
CREATE TABLE `pages` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`path` varchar(100) DEFAULT NULL,
`pageTitle` varchar(100) DEFAULT NULL,
`updatedOn` datetime DEFAULT NULL,
`html` text,
PRIMARY KEY (`ID`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8
A sample row-dump from the MySQL prompt, with special characters (Danish, in this case) looks correct, like this:
Code:
ID: 6
path: /test/
pageTitle: uft8-test
updatedOn: NULL
html: ÆØÅæøå
So far, so good. However, when I fetch the [tt]html[/tt] field from this row and output it with PHP I get only;
Code:
??????
I output from PHP with utf8 encoding set in my xhtml head block:
Code:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Stars, free drinks and eternal gratitude in exchange for advice
Thanks