This is version . It is not the current version, and thus it cannot be edited.
[Back to current version]   [Restore this version]
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 statusNewBug
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 found 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.

Add new attachment

Only authorized users are allowed to upload new attachments.
« This particular version was published on 09-Feb-2006 06:40 by 210.200.105.217.