You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by smithfox <ss...@gmail.com> on 2007/09/17 10:28:45 UTC

T5: UploadedFile componet is not compatible with UTF-8

Hi,
I wrote a web demo with UTF-8 filter, I could process Chinese character ,
and everything was in working order.
However, when I add a UploadFile component into the page. all Chinese
characters became unrecognizable.
If I remove the UploadFile, everything returned to normal.

Is this a bug of UploadFile or I should change the code?

-- 
View this message in context: http://www.nabble.com/T5%3A-UploadedFile-componet-is-not-compatible-with-UTF-8-tf4465167.html#a12731485
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Antwort: T5: UploadedFile componet is not compatible with UTF-8

Posted by smithfox <ss...@gmail.com>.
Thank your help.
I check out the lastest tapestry code, tapestry5.0.6 snapshot.
But found that the bug didn't fixed.
So I manually change apply the patch.


Christian Koeberl wrote:
> 
>> Is this a bug of UploadFile or I should change the code?
> This is a bug, see: https://issues.apache.org/jira/browse/TAPESTRY-1723
> 
> You can checkout the code, apply the patch and build your own 
> tapestry-upload.jar
> 
> -- 
> Chris
> 

-- 
View this message in context: http://www.nabble.com/T5%3A-UploadedFile-componet-is-not-compatible-with-UTF-8-tf4465167.html#a12749556
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: UploadedFile componet is not compatible with UTF-8

Posted by 蝈蝈龙 <el...@gmail.com>.
I ecountered the same problem .
I add
    <filter>
        <filter-name>encodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter
</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
        <init-param>
            <param-name>forceEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>*.html</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
  <filter>
to web.xml. works fine.

2007/9/18, Christian Koeberl <ch...@porsche.co.at>:
>
> > After packaging new package, but occur NullPointer Exception:
> > because request.getCharacterEncoding() == null
>
> You also have to add the UTF-8 filter described in
> http://wiki.apache.org/tapestry/Tapestry5Utf8Encoding
>
> --
> Chris

Re: T5: UploadedFile componet is not compatible with UTF-8

Posted by Christian Koeberl <ch...@porsche.co.at>.
> After packaging new package, but occur NullPointer Exception:
> because request.getCharacterEncoding() == null

You also have to add the UTF-8 filter described in 
http://wiki.apache.org/tapestry/Tapestry5Utf8Encoding

-- 
Chris

Re: Antwort: T5: UploadedFile componet is not compatible with UTF-8

Posted by smithfox <ss...@gmail.com>.
After packaging new package, but occur NullPointer Exception:
because
request.getCharacterEncoding() == null

so the line:
fieldValue = item.getString(request.getCharacterEncoding());
throw exception.
How to deal with the case.


Christian Koeberl wrote:
> 
>> Is this a bug of UploadFile or I should change the code?
> This is a bug, see: https://issues.apache.org/jira/browse/TAPESTRY-1723
> 
> You can checkout the code, apply the patch and build your own 
> tapestry-upload.jar
> 
> -- 
> Chris
> 

-- 
View this message in context: http://www.nabble.com/T5%3A-UploadedFile-componet-is-not-compatible-with-UTF-8-tf4465167.html#a12750499
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Antwort: T5: UploadedFile componet is not compatible with UTF-8

Posted by Christian Koeberl <ch...@porsche.co.at>.
> Is this a bug of UploadFile or I should change the code?
This is a bug, see: https://issues.apache.org/jira/browse/TAPESTRY-1723

You can checkout the code, apply the patch and build your own 
tapestry-upload.jar

-- 
Chris