TitleMessing chinese wiki page name
Date09-Feb-2006 06:40:11 EET
Version2.3.76
Submitter210.200.105.217
Bug criticalityBadBug
Browser versionIE, Firefox
Bug statusClosedBug
PageProvider used
Servlet ContainerTomcat 5.5
Operating SystemWindows XP
URL
Java versionJava Tiger

Using DefaultURLConstructor as default url constructor, JSPWiki would mess if the wiki page name is in chinese.

I checked out the implementation of DefaultURLConstructor.parsePage() method:

    public String parsePage( String context,
                             HttpServletRequest request,
                             String encoding )
        throws UnsupportedEncodingException
    {
        request.setCharacterEncoding( encoding );
        String pagereq = request.getParameter( "page" );

        if( context.equals(WikiContext.ATTACH) )
        {
            pagereq = parsePageFromURL( request, encoding );
        }

        return pagereq;
    }

request.setCharacterEncoding( encoding ); seems invalid, the value of pagereq is still encoded in ISO8859-1. When writing out to broswer, we got a messing result. (Of course, my jspwiki.encoding = UTF-8)

My patch is following:

        String pagereq = request.getParameter( "page" );

        if(pagereq != null)
            pagereq = TextUtil.urlDecode( pagereq, encoding );

        if( context.equals(WikiContext.ATTACH) )
        {
            pagereq = parsePageFromURL( request, encoding );
        }

        return pagereq;

BTW, www.jspwiki.org is ok because it uses ShortViewURLConstructor. The encoding problem is resolved by WikiServlet.


Fixed in 2.4.x. Please also check the TomcatAndUTF8 page.

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-3) was last changed on 14-Jul-2006 12:16 by Janne Jalkanen