[ 
https://issues.apache.org/jira/browse/JSPWIKI-602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12758595#action_12758595
 ] 

Peter Norsker commented on JSPWIKI-602:
---------------------------------------

We will give it a shot, and try to convert the files. I guess we also have to 
switch servlet container, we are using Tomcat at the moment, since Tomcat have 
a problem with UTF-8 encoding unless you set it on the container top level.

This is not an option though, wince we have a lot of applicationens, which are 
not using UTF-8, so we have to start a new container for JSPWiki with UTF-8 
support.

Thank you for your time. I will change the status to "wont fix"


> Encoding hardcoded when uploading attachment
> --------------------------------------------
>
>                 Key: JSPWIKI-602
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-602
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Core & storage
>    Affects Versions: 2.8.2
>            Reporter: Peter Norsker
>
> In the AttachmentServlet in the upload method, the encoding UTF-8 is 
> hardcoded. This make the upload break when uploading to a wiki page with 
> international charaters (such as æøå in the danish language) and the wiki 
> runs with encoding ISO-8859-1. The encoding used in this servlet should be 
> fetched from the WikiEngine instead of being hardcoded.
> I have made a fix for our installation in this class by adding the following 
> to the upload method:
> -- snip --
>             // Create the context _before_ Multipart operations, otherwise
>             // strict servlet containers may fail when setting encoding.
>             WikiContext context = m_engine.createContext( req, 
> WikiContext.ATTACH );
>             String encoding = context.getEngine().getContentEncoding(); // 
> part of fix
>             UploadListener pl = new UploadListener();
>             m_engine.getProgressManager().startProgress( pl, progressId );
>             ServletFileUpload upload = new ServletFileUpload(factory);
>             upload.setHeaderEncoding(encoding); // part of fix
>             upload.setFileSizeMax( m_maxSize );
> -- snip --
>                         wikipage = item.getString(encoding); // part of fix
>                         int x = wikipage.indexOf("/");
>                         if( x != -1 ) wikipage = wikipage.substring(0,x);
>                     }
>                     else if( item.getFieldName().equals("changenote") )
>                     {
>                         changeNote = item.getString(encoding);  // part of fix
>                     }
>                     else if( item.getFieldName().equals( "nextpage" ) )
>                     {
>                         nextPage = validateNextPage( 
> item.getString(encoding), errorPage );  // part of fix
> -- snip --

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to