thanks for that quick reply !
This is part of my databases.yml file
dev:
poptract:
class: sfPropelDatabase
param:
encoding: utf8
dsn: mysql://xxxxx:[EMAIL PROTECTED]:3306/mybase
And if you look closer at my /create table /statement, you will notice
that I have defined the charser and the collation for the columns :-(
The silly thing I do not understand is why I have no accent problem with
a *var_dump* instruction, but when I call *echo $projet->getLibelle()* I
have some kind of ansi -> utf8 encoding that seems to be happening ...
Alistair Stead a écrit :
> Two things to check...
>
> Have you connected to the database with a UTF-8 connection flag....
> This used to be a bug with creole but I believe that has been resolved
> for some time...
>
> Also your columns will also need to be set to UTF char set... not just
> the tables.
>
> symfony out of the box usually works with multi-byte chars. I would
> start looking at the database first and be careful if you are
> exporting date to re-import to the database.
>
> Alistair
>
> On 09/01/2008, *Peter HO* <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> > wrote:
>
> Hi list,
>
> I have a funny problem with Peer Objects and UTF-8 encoded databases.
>
> Here is a sample of my database :
>
> CREATE DATABASE `poptract` DEFAULT CHARACTER SET utf8 COLLATE
> utf8_unicode_ci;
> USE `poptract`;
>
> CREATE TABLE `projets` (
> `idProjet` bigint(20) NOT NULL AUTO_INCREMENT,
> `libelle` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci
> DEFAULT NULL,
> `dateDebut` date DEFAULT NULL,
> `statut` smallint(6) DEFAULT NULL,
> `dateFin` date DEFAULT NULL,
> `idClient` bigint(20) DEFAULT NULL,
> `baseNom` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci
> DEFAULT NULL,
> `dateCreation` date DEFAULT NULL,
> PRIMARY KEY (`idProjet`),
> KEY `WDIDX11986616292` (`libelle`),
> KEY `WDIDX11986616293` (`idClient`)
> ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ;
>
>
>
> All my files are UTF-8 encoded, I have added
>
> charset: utf-8
>
> in my settings.yml,
>
> charset: UTF-8
>
> in view.yml's metas section,
>
>
> param:
> encoding: utf8
>
>
> in databases.yml.
>
> And now the funny part :
> In my action :
>
> $this->projets = ProjetsPeer::retrieveByPK(11);
>
>
> In my view :
>
> var_dump($projets)
> returns me :
> object(Projets)#97 (14) {
> ["idprojet:protected"]=>
> string(2) "11"
> ["libelle:protected"]=>
> string(16) "é a a a test è"
> ["datecreation:protected"]=>
> NULL
> ["datedebut:protected"]=>
> NULL
> ["statut:protected"]=>
> NULL
> ["datefin:protected"]=>
> NULL
> ["idclient:protected"]=>
> string(1) "1"
> ["basenom:protected"]=>
> string(6) "blabla"
> ["alreadyInSave:protected"]=>
> bool(false)
> ["alreadyInValidation:protected"]=>
> bool(false)
> ["validationFailures:protected"]=>
> array(0) {
> }
> ["_new:private"]=>
> bool(false)
> ["_deleted:private"]=>
> bool(false)
> ["modifiedColumns:protected"]=>
> array(0) {
> }
> }
>
>
>
> when
>
> echo $projet->getLibelle()
> gives me
> é a a a test è <== see these characters ?
>
>
>
>
> Any Ideas ?
>
> Peter
>
> P.S. : I have the same result with PHP 5.1.2 / Apache 2.2.0 /
> MySQL 5.0.20 / Symfony 1.0.10 / Win XP Pro SP2 and with gentoo
> 2.6.19 / PHP 5.2.2-pl1-gentoo / Mysql 5.0.26 / Symfony 1.0.6 /
> Apache 2.0.58
>
>
>
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---