You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2005/04/16 12:48:38 UTC

DO NOT REPLY [Bug 34483] New: - fileupload should use ServletRequest encoding as default

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34483>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34483

           Summary: fileupload should use ServletRequest encoding as default
           Product: Commons
           Version: 1.0 Final
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: File Upload
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: amichai2@amichais.net


The fileupload package operates on a ServletRequest to conveniently extract it's
content. The ServletRequest.getCharacterEncoding() method "Returns the name of
the character encoding used in the body of this request", and thus should be
used as a default by the fileupload processing as well.

Further, whether from the servlet request or an explicit set on the FileUpload
instance, the encoding should propagate to the FileItem (again by default,
unless it's overridden by a part content type header or explicit set).

Currently, in order to have a UTF-8 request properly parsed, one must first call

request.setCharacterEncoding("UTF-8")

then call

diskFileUpload.setHeaderEncoding("UTF-8")

and finally use

fileItem.getString("UTF-8")

There's no reason for this duplicity - if the first is set, the rest should
propagate by default, unless explicitly overridden. This is a source for bugs
and unneeded extra work (it took quite a while to figure these out, after
examining the source code - this work can be saved for other developers, after
all, that's what this package is for!).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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