Hello,

http headers are essentially ASCII. Especially for things like the
boundary. The arguments (filename) might be QP, but not all browsers
like that.

Gruss
Bernd

Am Mon, 1 Aug 2016 12:10:24 -0700
schrieb Gary Gregory <[email protected]>:

> I can see that
> in org.apache.commons.fileupload.FileUploadBase.getBoundary(String)
> we have:
> 
>   boundary = boundaryStr.getBytes("ISO-8859-1");
> 
> Should that be:
> 
>   boundary = boundaryStr.getBytes(headerEncoding);
> 
> ?
> 
> Gary
> 
> On Mon, Aug 1, 2016 at 11:01 AM, Campbell, Lance <[email protected]>
> wrote:
> 
> > There is still an issue.
> > I had a typo in my email.  There should not have been the line
> > resp.setContentType("UTF-8");
> >
> > Sorry.
> >
> >
> >
> > -----Original Message-----
> > From: Campbell, Lance [mailto:[email protected]]
> > Sent: Monday, August 01, 2016 12:51 PM
> > To: '[email protected]' <[email protected]>
> > Subject: [fileupload] UTF-8 encoding issue
> >
> > Commons File Upload 1.3.2
> >
> > I am using the commons file upload version 1.3.2 via servlets for
> > apache-tomcat 8.  All of my servlets work with UTF-8 except for
> > when I am using the commons file upload library.  It seems to be
> > setting the encoding to "ISO-8859-1" .  I have set both the request
> > and response headers to UTF-8.  I have also set the Java VM to use
> > UTF-8.
> >
> > How can I get around this issue?
> >
> > I have read online to do the following:
> > req.setCharacterEncoding("UTF-8");
> > resp.setContentType("UTF-8");
> > resp.setCharacterEncoding("UTF-8");
> >
> > I have also read to set this at the form:
> >
> > accept-charset="UTF-8"
> >
> > It seems like your code is hardcoding the encoding to "ISO-8859-1"
> > in the class FileUploadBase.
> >
> > Why not allow us to set the encoding in a method then use the
> > "ISO-8859-1" as a fall back?
> >
> > Thanks,
> >
> > Lance Campbell
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to