You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2013/05/16 13:15:20 UTC

[Bug 54984] New: multipart/form-data is not always read with correct encoding

https://issues.apache.org/bugzilla/show_bug.cgi?id=54984

            Bug ID: 54984
           Summary: multipart/form-data is not always read with correct
                    encoding
           Product: Tomcat 7
           Version: 7.0.40
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: holmis83@gmail.com
    Classification: Unclassified

The bug occurs when form data is posted as multipart/form-data and using
Servlet 3 API to get posted files.
In a servlet, if we set the encoding:

request.setCharacterEncoding("UTF-8");

Then invoke:

request.getParts()

And then invoke:

String text = request.getParameter("sometextfield");

UTF-8 characters in the text have been garbled.

Order of method calls are significant, if a getParameter is called before
getParts, the correct encoding will be used.
However, the order which you invoke the methods should not matter.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 54984] multipart/form-data is not always read with correct encoding

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54984

--- Comment #1 from Christopher Schultz <ch...@christopherschultz.net> ---
Can you post a simple test-case as a WAR (including source) to reproduce this?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 54984] multipart/form-data is not always read with correct encoding

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54984

--- Comment #2 from Per Holmberg <ho...@gmail.com> ---
Created attachment 30311
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30311&action=edit
Multipart demo war

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 54984] multipart/form-data is not always read with correct encoding

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54984

Violeta Georgieva <vi...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Violeta Georgieva <vi...@apache.org> ---
Thanks for the report.
Fixed in trunk and 7.0.x and will be included in 7.0.41 onwards.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 54984] multipart/form-data is not always read with correct encoding

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54984

--- Comment #3 from Per Holmberg <ho...@gmail.com> ---
Created attachment 30312
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30312&action=edit
Multipart demo source

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org