Hi Shawn,

            Thank you for your advice, I able to work with Japanese char.
Below is additional information I found and hopefully help others.



------------------------------------------------

Setting DBForms to work with Japanese char.

1. Configure the dbforms-config.xml



<dbconnection

name   ="jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&amp;characterEncoding=Shif
t_JIS"

isJndi = "false"

conClass  = "com.mysql.jdbc.Driver"

username = "staff"

password  = "secret"

/>



2. Add this to web.xml



    <!-- Example filter to set character encoding on each request -->

    <filter>

        <filter-name>Set Character Encoding</filter-name>


<filter-class>openSource.filters.SetCharacterEncodingFilter</filter-class>

        <init-param>

            <param-name>encoding</param-name>

            <param-value>Shift_JIS</param-value>

        </init-param>

    </filter>

    <filter-mapping>

        <filter-name>Set Character Encoding</filter-name>

        <url-pattern>/*</url-pattern>

    </filter-mapping>



3. Compile and add in the lib or classes (I found this class in the web
search “Shift_JIS” in google)



--------------------------- Code Start
here -------------------------------------

/** SetCharacterEncodingFilter.java

Who ever made this class Thank you very much!!!!!!!!

If ever you make another good stuff please put your name on it so I can
thank you directly.



**/

/**





     <!-- Example filter to set character encoding on each request -->

    <filter>

        <filter-name>Set Character Encoding</filter-name>


<filter-class>openSource.filters.SetCharacterEncodingFilter</filter-class>

        <init-param>

            <param-name>encoding</param-name>

            <param-value>Shift_JIS</param-value>

        </init-param>

    </filter>

    <filter-mapping>

        <filter-name>Set Character Encoding</filter-name>

        <url-pattern>/*</url-pattern>

    </filter-mapping>

 */

package openSource.filters;



import java.io.IOException;

import javax.servlet.Filter;

import javax.servlet.FilterChain;

import javax.servlet.FilterConfig;

import javax.servlet.ServletException;

import javax.servlet.ServletRequest;

import javax.servlet.ServletResponse;

import javax.servlet.UnavailableException;



/**

 * Example filter that sets the character encoding to be used in parsing the

 * incoming request, either unconditionally or only if the client did not

 * specify a character encoding.

 */

public class SetCharacterEncodingFilter implements Filter {

    protected String encoding = null;

    protected FilterConfig filterConfig = null;

    protected boolean ignore = true;



    /**

     * Take this filter out of service.

     */

    public void destroy() {

        this.encoding = null;

        this.filterConfig = null;

    }



    /**

     * Select and set (if specified) the character encoding to be used to

     * interpret request parameters for this request.

     */

    public void doFilter(ServletRequest request, ServletResponse response,

                         FilterChain chain)

    throws IOException, ServletException {

        // Conditionally select and set the character encoding to be used

        if (ignore || (request.getCharacterEncoding() == null)) {

            String encoding = selectEncoding(request);

            if (encoding != null)

                request.setCharacterEncoding(encoding);

        }

    // Pass control on to the next filter

        chain.doFilter(request, response);

    }



    /**

     * Place this filter into service.

     */

    public void init(FilterConfig filterConfig) throws ServletException {

        this.filterConfig = filterConfig;

        this.encoding = filterConfig.getInitParameter("encoding");

        String value = filterConfig.getInitParameter("ignore");

        if (value == null)

            this.ignore = true;

        else if (value.equalsIgnoreCase("true"))

            this.ignore = true;

        else if (value.equalsIgnoreCase("yes"))

            this.ignore = true;

        else

            this.ignore = false;

    }



    /**

     * Select an appropriate character encoding to be used, based on the

     * characteristics of the current request and/or filter initialization

     * parameters.  If no character encoding should be set, return

     * null.

     */

    protected String selectEncoding(ServletRequest request) {

        return (this.encoding);

    }

}



--------------------------- Code End
here -------------------------------------









----------------------------------------------------------

For Programmer having problem making DBForms run



This combination is good.

j2sdk1.4.2_04

Apache Tomcat/5.0.25

dbforms_2.3_20040329



When I first run my web app other default webapp turn off, To solve this try
copying this jar file in Tomcat 5.0\common\lib listed below.



commons-logging-1.0.3.jar

log4j-1.2.8.jar



--------------------------------------------------------

For those having a null error when browsing your page with dbform

Try to double check dbforms-config.xml there might be some fieldType that is
not yet supported.







Best Regards,

John



----- Original Message -----
From: "Shawn" <
[EMAIL PROTECTED]>
To: "Sir John" <
[EMAIL PROTECTED]>; "dbforms developers"
<
[EMAIL PROTECTED]>
Sent: Wednesday, June 09, 2004 2:05 PM
Subject: Re: [Jdbforms-developers] Japanese Character


> Hi,
>
> Questions like these should go to
[EMAIL PROTECTED]
>
> >
"jdbc:mysql://127.0.0.1:3306/database?useUnicode=true&characterEncoding=SJIS
"
>
> in dbforms use
>
>
"jdbc:mysql://127.0.0.1:3306?useUnicode=true&amp;characterEncoding=Shift_JIS
"
>
> --
> Shawn
>
> Happily using M2, Opera's revolutionary e-mail client:
>
http://www.opera.com/m2/
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: GNOME Foundation
> Hackers Unite!  GUADEC: The world's #1 Open Source Desktop Event.
> GNOME Users and Developers European Conference, 28-30th June in Norway
>
http://2004/guadec.org
> _______________________________________________
> Jdbforms-developers mailing list
>
[EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jdbforms-developers
>

Reply via email to