Return-Path: Mailing-List: contact commons-httpclient-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-httpclient-dev@jakarta.apache.org Received: (qmail 15563 invoked from network); 7 Apr 2003 11:49:09 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 7 Apr 2003 11:49:09 -0000 Received: (qmail 14040 invoked by uid 50); 7 Apr 2003 11:50:59 -0000 Date: 7 Apr 2003 11:50:59 -0000 Message-ID: <20030407115059.14039.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: commons-httpclient-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 18752] - the method to change the field values of HttpConstants X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18752 the method to change the field values of HttpConstants adrian@ephox.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID ------- Additional Comments From adrian@ephox.com 2003-04-07 11:50 ------- The values of these fields are set according the HTTP specification and so should not be changed. Despite this, HttpClient can very simply be used with alternative character sets and there are a number of options for doing this. The best and most compliant method is to set the server to correctly report the character encoding and HttpClient will honour that. For instance if the HTTP server returns a header: Content-Type: text/html; charset=SJIS HttpClient will use the SJIS character encoding when you call getResponseBodyAsString. Alternatively, you can simply retrieve the response body as either an input stream or a byte array then use whatever file encoding you prefer. The HTTP_ELEMENT_CHARSET is always and must always be US-ASCII as that is the character encoding used for Http headers. It is therefore not possible to use double byte characters in the Http headers as this is not supported by the HTTP protocol. This however, has no effect on the contents of the request or response body which may use any character encoding or be binary data. There is more information on character encodings and HttpClient at: http://jakarta.apache.org/commons/httpclient/charencodings.html Generally though it is the responsibility of the application to select and apply the appropriate character set as HttpClient normally does not process the response body at all. If you need further assistance, I'd be happy to help, please subscribe to the HttpClient Developer list and ask any questions you have there. Details of the list are at: http://jakarta.apache.org/commons/httpclient/mail-lists.html