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

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

[~dtsaryov] It was not working OK. Non-ASCII chars in HTTP message heads and in 
URIs are illegal. HttpClient prior to 4.5.7 did allow them in request URIs, 
though they might have gotten garbled later during HTTP message transmission. 

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