I'm doing a project with zend framework and I'm pulling data from a utf-8 database. The project is utf-8 as well.
In a form, I have a select element displaying a list of countries. The problem is: In french or spanish, some countries are not displayed.
After doing a var_dump() of my country list, I saw that those were the countries with special characters. Accented ones.
in the var_dump I could see the character represented as a ? in a diamond. I tried changing the encoding to iso-8859-1 and I could see the var_dump result with the special characters just fine.
How come data coming from a utf-8 database are displaying in iso-8859-1!
Can I store iso-8859-1 character set in a utf-8 table in mysql without problem? Shouldn't it display messed up characters?
confused.
--
delimiter $$ CREATE TABLE `geo_Country` ( `CountryID` int(10) NOT NULL, `CountryName` varchar(45) NOT NULL, `CountryCompleteName` varchar(45) NOT NULL, `Nationality` varchar(45) NOT NULL, `CreationDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `Status` tinyint(1) NOT NULL DEFAULT '1', `LanguageCode` char(2) NOT NULL, `ZoneID` int(10) NOT NULL, PRIMARY KEY (`CountryID`,`LanguageCode`), KEY `fk_geo_Country_web_Language1` (`LanguageCode`), KEY `fk_geo_Country_geo_Zone` (`ZoneID`), KEY `idx_CountryName` (`CountryName`) CONSTRAINT `fk_geo_Country_geo_Zone` FOREIGN KEY (`ZoneID`) REFERENCES `geo_Zone` (`ZoneID`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_geo_Country_web_Language1` FOREIGN KEY (`LanguageCode`) REFERENCES `web_Language` (`LanguageCode`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8$$
SHOW CREATE TABLE mytablefor the table involved and the relevant part of the PHP code you are running?I tried changing the encoding to iso-8859-1- what encoding you tried to change and how?