[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529511
 ] 

Christopher Sahnwaldt commented on HTTPCLIENT-691:
--------------------------------------------------

I added another few lines that may help to clarify the issue:

URI uri = new URI("http"+"://bär.de/bär?bär=eis", false);
System.out.println(uri.getHost());
System.out.println(uri.getRawHost());
System.out.println(uri.getPath());
System.out.println(uri.getRawPath());
System.out.println(uri.getQuery());
System.out.println(uri.getRawQuery());
System.out.println(uri.isHostname());

prints

b?r.de
bär.de
/bär
/b%C3%A4r
bär=eis
b%C3%A4r=eis
false

For path and query, the 'raw' version is properly escaped, the other version is 
unescaped. For host, the 'raw' version is *not* escaped, but getHost() still 
tries to unescape it and messes things up.


> URI does not handle non-ASCII characters in host names correctly
> ----------------------------------------------------------------
>
>                 Key: HTTPCLIENT-691
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-691
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>            Reporter: Christopher Sahnwaldt
>            Priority: Minor
>
> URI uri = new URI("http://www.eisbär.de/eisbär?eis=bär";, false);
> System.out.println(uri.getHost());
> System.out.println(uri.getPath());
> System.out.println(uri.getQuery());
> prints
> www.eisb?r.de
> /eisbär
> eis=bär

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to