Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 81882 invoked from network); 8 Aug 2004 06:49:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 8 Aug 2004 06:49:17 -0000 Received: (qmail 84172 invoked by uid 500); 8 Aug 2004 06:49:09 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 84122 invoked by uid 500); 8 Aug 2004 06:49:08 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 84109 invoked by uid 99); 8 Aug 2004 06:49:08 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=MANY_EXCLAMATIONS X-Spam-Check-By: apache.org Received: from [199.203.223.202] (HELO exg.allot.com) (199.203.223.202) by apache.org (qpsmtpd/0.27.1) with ESMTP; Sat, 07 Aug 2004 23:49:05 -0700 Received: by mail.allot.com with Internet Mail Service (5.5.2653.19) id ; Sun, 8 Aug 2004 09:50:48 +0200 Message-ID: From: Guy Katz To: 'Jakarta Commons Users List' Subject: RE: [FileUpload] character encoding problem (URGENT! PLZ HELP!) Date: Sun, 8 Aug 2004 09:50:47 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N hi; i had the same problem over the weekend indirectly using the fileupload = JSF component based on commons-upload. to my understanding, commons-fileupload does not support proper = encoding of form fields that are not files. i tweaked the source code, and put an encoding filter in front of my = web app but it did not do the trick. i think this is an important feature missing from this project. there is a very well known stable package alternative which accepts an encoding parameter to the multipart/form-data parser and works great (www.servlets.com) thanks. -----Original Message----- From: Jason Lea [mailto:jason@kumachan.net.nz] Sent: Friday, August 06, 2004 4:37 PM To: Jakarta Commons Users List Subject: Re: [FileUpload] character encoding problem (URGENT! PLZ = HELP!) If the content is a file it should just be base64 encoded or something, = so it can be saved using the FileUpload component's methods. But form=20 fields would suffer encoding problems, and so too would the filename of = the file. Here are some ideas: You need to set the page encoding when you send it to the browser so it = knows what encoding you are using. Such as (in a .jsp page) <%@ page contentType=3D"text/html; charset=3DUTF-8"%> Or in java (I think): response.setContentType("text/html; = charset=3DUTF-8"); When you receive the request you can force the encoding too.=20 The request can also have the encoding set on it. =20 request.setCharacterEncoding("UTF-8"); I guess you could try each of those. Replace UTF-8 with what ever=20 encoding you are using. J=E9r=E9mie LOPEZ wrote: >Thanks for answering... > >Well, I tried it (with "iso-8859-1", not "UTF-8", but it should give = the >same results for my problem I suppose), and it didn't work. >Btw, from the javadoc, it just sets the encoding for the header of the >request parts, not the content... > > > >-----Message d'origine----- >De : Jason Lea [mailto:jason@kumachan.net.nz]=20 >Envoy=E9 : vendredi 6 ao=FBt 2004 16:09 >=C0 : Jakarta Commons Users List >Objet : Re: [FileUpload] character encoding problem (URGENT! PLZ = HELP!) > >I would assume you do something like this: > >DiskFileUpload upload =3D new DiskFileUpload(); > > >upload.setHeaderEncoding("UTF-8"); > >(I haven't tried it myself.) > >J=E9r=E9mie LOPEZ wrote: > > =20 > >>Hi all, >> >>I'm using the Commons FileUpload in a webapp hosted on a unix server. >>When a windows client uploads a text file with accented characters,=20 >>they're replaced by '?' or '=FD'... >>I suppose I must specify some character encoding or that sort of = thing,=20 >>but where and what exactly? >> >>TIA >> >>JimmyL. >> >>=20 >> >> =20 >> > > >-- >Jason Lea > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: commons-user-help@jakarta.apache.org > > =20 > --=20 Jason Lea --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org