You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Ortwin Glück <or...@nose.ch> on 2004/05/25 15:19:04 UTC

Re: retrieved wired code for Unicode


K.M. Ku wrote:

> Hi Mike
> 
> Thx for info. However, I cannot get the correct Unicode character after
> storing in String. It is oK for ISO8859 (as it is the default charset of
> httpclient, right?). Can you share me the correct method to store the
> Unicode characters into String variable?
> 
> Thx a millon.
> KMKU


The server should set the correct encoding in the Content-Type header. 
Then you can use HttpMethod#getResponseAsString.

Otherwise use HttpMethod#getResponseAsStream and use a 
java.io.InputStreamReader with a specified encoding.




-- 
  _________________________________________________________________
  NOSE applied intelligence ag

  ortwin glück                      [www]      http://www.nose.ch
  software engineer                 [email] ortwin.glueck@nose.ch
  hardturmstrasse 171               [pgp id]           0x81CF3416
  8005 zürich                       [office]      +41-1-277 57 35
  switzerland                       [fax]         +41-1-277 57 12

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