commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Sangster" <james.sangs...@newswire.ca>
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
StringPart.

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.

james

-----Original Message-----
From: James Sangster [mailto:james.sangster@newswire.ca] 
Sent: Wednesday, May 18, 2005 11:12 AM
To: commons-user@jakarta.apache.org
Subject: [httpclient] multipart/form-data post character encoding of string
parts


Hi,
 
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.
 
Thanks,
james


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


Mime
View raw message