You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Paranoid <pa...@ukr.net> on 2007/03/17 19:26:33 UTC

can i set url encoding?

hi all!

there is a server in internet, it uses russian letters, special symbols and 
spaces in url. i use org.apache.commons.httpclient.util.URIUtil - it helps 
really well when you know what encoding is used, but can i set some sort of 
request header or just send some request to find out what encoding is used by 
server url? i can see it in the browser, but i cant write automated tool for 
this...
-- 
    best regards,
        Paranoid

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


Re: can i set url encoding?

Posted by Roland Weber <ht...@dubioso.net>.
Hallo Paranoid,

there is no standard way of determining an encoding for
URLs. The standard is US-ASCII, nothing else allowed.
A common non-standard is UTF-8. Otherwise, you'll have
to guess. You could try to fetch some page from the
server and see what encoding is used for the _content_
of that page. Of course there's no guarantee that the
same encoding will be understood for URLs.
Odi provides some details on URL character encoding in
our Application Design FAQ, section "GET with Query":
http://wiki.apache.org/jakarta-httpclient/FrequentlyAskedApplicationDesignQuestions#head-608332884523b67a1e00f1b5f2a7a144fa58ca64

hope this helps,
  Roland

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