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

Oleg Kalnichevski commented on HTTPCLIENT-1996:
-----------------------------------------------

[~dtsaryov] Non-ASCII characters (not just Cyrrilic but also German umlauts, 
etc) are not legal in all URI components. They need to be encoded in order to 
avoid URI corruption in transit.

If you do not want HttpClient to normalize request URIs you can disable it with 
{{RequestConfig}} class.

Oleg

> Cyrillic characters are incorrectly encoded
> -------------------------------------------
>
>                 Key: HTTPCLIENT-1996
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1996
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 4.5.8
>            Reporter: Daniil Tsaryov
>            Priority: Major
>         Attachments: httpclient-cyrillic.zip
>
>
> Starting with version 4.5.8 URIUtils.rewriteUri encodes Cyrillic characters 
> in the wrong way.
> Consider the following test:
> {code:java}
> String src = "http://www.яндекс.рф/тестовый-адрес";;
> URI srcUri = new URL(src).toURI();
> String targetPath = "http://localhost:8080/тестовый-адрес";;
> HttpHost targetHost = new HttpHost("localhost", 8080, "http");
> URI targetUri = URIUtils.rewriteURI(srcUri, targetHost);
> Assert.assertEquals(targetPath, targetUri.toString());
> {code}
> As a result:
> {code:java}
> Expected :http://localhost:8080/тестовый-адрес
> Actual   :http://localhost:8080/B5AB%3E2K9-04@5A
> {code}
> Please check demo project in attachments



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to