Hello,

I do realize that this might not be the ideal way to ask questions about quercus but the quercus mailing list doesn't work like so many other things on thise website.


I'm trying to use a MySQL database based on utf8 charset with quercus php but any non-standard characters will show up as question marks ? and I have not found any way to change the charset used by quercus to read data from the database. Basically it's database connection is stuck with ISO-8859-1 encoding although they state at several places that Quercus is natively utf8.

My setup is Tomcat 6.0.16 with Quercus 3.1.5

Basically I need to know how I can get a database connection that will allow me to display text comming from the utf8 based database with all the correct characters.

Thanks for any help

Stefan Graf




This is my current configuration:

--- web.xml ---

<?xml version="1.0" encoding="UTF-8"?>

<web-app id="TestWeb" version="2.5"
        xmlns="http://java.sun.com/xml/ns/javaee";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http:// java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

        <display-name>TestWeb</display-name>
        <description>Test Web Application</description>

        <resource-ref>
        <description>DBConnection</description>
        <res-ref-name>jdbc/mydb</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>

        <servlet>
                <servlet-name>Quercus</servlet-name>
                <servlet-class>
                        com.caucho.quercus.servlet.QuercusServlet
                </servlet-class>
                <init-param>
                        <param-name>ini-file</param-name>
                        <param-value>WEB-INF/php.ini</param-value>
                </init-param>
                <init-param>
                        <param-name>database</param-name>
<param-value>java:comp/env/jdbc/mydb</param- value>
                </init-param>
                <load-on-startup>1</load-on-startup>
        </servlet>

        <servlet-mapping>
                <servlet-name>Quercus</servlet-name>
                <url-pattern>*.php</url-pattern>
        </servlet-mapping>

        <welcome-file-list>
                <welcome-file>index.php</welcome-file>
                <welcome-file>index.html</welcome-file>
                <welcome-file>index.htm</welcome-file>
        </welcome-file-list>

</web-app>


--- context.xml ---

<Resource name="jdbc/mydb" auth="Container" type="javax.sql.DataSource"
             maxActive="100" maxIdle="30" maxWait="10000"
             username="user" password="password"
             driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/mydb? autoReconnect=true&amp;characterEncoding=utf8"/>
_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to