commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Sangster" <>
Subject [httpclient] multipart/form-data post character encoding of string parts
Date Wed, 18 May 2005 15:11:58 GMT
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.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message