• Post Reply Bookmark Topic Watch Topic
  • New Topic

Charset problems Jakarta Commons HttpClient vs. ASP  RSS feed

 
R�diger Engelberger
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm sending a POST request with Jakarta HttpClient (MultipartPostMethod because I'm also sending a file). The target is an ASP script. I get into troubles when I'm sending special characters (like "�", "�" etc.). They get corrupt!

In addition to ASP 2.0 there's an ActiveX control on the IIS which processes the file upload. So the ASP script doesn't process the Request object directly but gets the request parameters from the ActiveX control, i.e.:



But I don't know which charset is expected by this ActiveX control. I thought it could be Windows-1252 or UTF-8.

So I tried to do the following with HttpClient:



... to set the encoding of the request. I also tried it with UTF-8 but without success.

The same ASP script works when sending the file and additional parameters by a simple HTML form. The form contains:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

... is the request to the ASP script also encoded with UTF-8?

So my questions:
----------------

- is the way to set the encoding of a request
and its parameters correct?

- if no ... how can I do it correctly?

- if yes ... what else could be a problem?

Many thanks in advance!

Greetings
R�diger Engelberger
 
Matthew Amacker
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I've never used the ActiveX thingy you are trying to use but from a quick scan of the web it appears that it is a utility for uploading files and this page states that it will only accept multipart/form-data:
http://mfc.dundas.com/products/onlinedocs/FreeProds/upload/How_to_use_Dundas_Upload.htm

So you need to set the content type as:
postMethod.setRequestHeader("Content-Type", "multipart/form-data");

I hope I'm not stating the obvious.

Good luck.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!