Daniil Tsaryov created HTTPCLIENT-1996:
------------------------------------------
Summary: 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
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]