Hello,

Finally, I have found the complete solution in this page : 
http://blog.agavi.org/post/6246975561/agavi-1-0-5-rc1-released : 


"... in 
older versions of PHP, the PDO MySQL driver ignores the “charset” option in the 
DSN. If your my.cnf configuration file specifies “latin1” and 
you simply switch to UTF-8 using “SET NAMES utf8”, this is no problem, 
but for some charsets, this may result in the quoting issues mentioned 
above. This is why AgaviPdoDatabase requires you to set 
“warn_mysql_charset” to false in such environments. With this flag 
explicitly disabled, it will also be possible to use “SET NAMES” init 
queries again, but be advised that this is at your own risk..." 


So I kept Guilherme's suggestion and I added the parameter "warn_mysql_charset" 
to false. The result is : 


<ae:configurations xmlns:ae="http://agavi.org/agavi/config/global/envelope/1.0"; 
xmlns="http://agavi.org/agavi/config/parts/databases/1.0";>
    
    <ae:configuration>
        <databases default="pdo_mysql_main">         

   
            <database name="pdo_mysql_main" class="AgaviPdoDatabase">
                <ae:parameter 
name="dsn">mysql:host=localhost;dbname=benchmark;charset=utf8</ae:parameter>
                <ae:parameter name="username">root</ae:parameter>
                <ae:parameter name="password">...</ae:parameter>
                <ae:parameter name="warn_mysql_charset">false</ae:parameter>
                <ae:parameter name="init_queries">
                    set names utf8;
                </ae:parameter> 
             </database>

        </databases>
    </ae:configuration>
</ae:configurations>


Thanks to you Guilherme !

Xavier

_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users

Reply via email to