Mantis - Quercus
Viewing Issue Advanced Details
4479 major always 04-05-11 11:17 04-07-11 02:53
chiefgeek  
 
normal  
new 4.0.7  
open  
none    
none  
0004479: mysql connection collation is not honored (wordpress)
I have a db with tables that were created with utf8 as default and data populated as utf8 character set. When viewing the data from the db via quercus the data is corrupt.

I have added a set names utf8 after the mysql_connect call and it appears to have no affect.

I have tried adding '?characterEncoding=utf8' on the jdbc url but the startup fails when that option is in place.
resin-web.xml
<web-app xmlns="http://caucho.com/ns/resin" [^]
        xmlns:resin="urn:java:com.caucho.resin">
    <database>
        <jndi-name>jdbc/mysql</jndi-name>
        <driver type="com.mysql.jdbc.Driver">
            <url>jdbc:mysql://db001.stg:3306/wp_cms</url> [^]
            <user></user>
            <password></password>
        </driver>
        <prepared-statement-cache-size>8</prepared-statement-cache-size>
        <max-connections>20</max-connections>
        <max-idle-time>30s</max-idle-time>
        <spy />
    </database>

    <servlet servlet-name="quercus" servlet-class="com.caucho.quercus.servlet.QuercusServlet">
        <init>
            <compile>false</compile>
            <script-encoding>iso-8859-1</script-encoding>
<database>java:comp/env/jdbc/mysql</database>
            <ini-file>WEB-INF/php.ini</ini-file>
        </init>
    </servlet>
 Screen shot 2011-04-05 at 1.10.55 PM.png [^] (42,326 bytes) 04-05-11 11:17
 Screen shot 2011-04-05 at 1.53.17 PM.png [^] (43,696 bytes) 04-05-11 11:53

Notes
(0005153)
chiefgeek   
04-05-11 11:54   
The second screen shot is the same wordpress db running under apache + php5
(0005175)
kdecherf   
04-07-11 02:53   
This issue exists because all Quercus source code is not Unicode compliant.

You can find a solution here : https://github.com/CleverCloud/Quercus/tree/unicode [^]