commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Sangster" <>
Subject RE: [httpclient] multipart/form-data post character encoding of string parts
Date Wed, 18 May 2005 15:58:35 GMT
Indeed, the encoding can be set on individual StringParts.

setCharSet method or add the third parameter for the constructor of

I stated my charset to be ISO-8859-1 and this resolved the issue of the
recipient server not being able to parse the value properly.


-----Original Message-----
From: James Sangster [] 
Sent: Wednesday, May 18, 2005 11:12 AM
Subject: [httpclient] multipart/form-data post character encoding of string

I have build a generic function which returns a PostMethod, which is
constructed from an array of StringPart and FilePart objects.   It is
possible that this PostMethod could be constructed entirely of StringPart
objects, depending opun the task it has been assigned to create (it was
written for generic use, but that may be the kicker here).
My problem right now is with special characters (for example, some of the
french accented characters).  When I issue this multipart/form-data
PostMethod, the recipient server is not picking up these special characters
(it's turning them into the ? character).
Is it possible for me to set the character encoding on each string part? Or
is there something else going on here that I'm not taking into account?
One thing I have tried is to URLEncoder.encode each StringPart value with
the charset of ISO-8859-1, but the recipient server makes an even bigger
mess of the request than without trying to do the encoding.
Any help on this is greatly appreciated.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message