Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5656418439 for ; Mon, 28 Dec 2015 16:23:50 +0000 (UTC) Received: (qmail 26361 invoked by uid 500); 28 Dec 2015 16:23:50 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 26235 invoked by uid 500); 28 Dec 2015 16:23:50 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 26194 invoked by uid 99); 28 Dec 2015 16:23:49 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Dec 2015 16:23:49 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id BB4592C0451 for ; Mon, 28 Dec 2015 16:23:49 +0000 (UTC) Date: Mon, 28 Dec 2015 16:23:49 +0000 (UTC) From: "Idan Sheinberg (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HTTPCLIENT-1708) Issues With Extended ASCII ( Latin Chars ) Escaping with HttpClient 4.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HTTPCLIENT-1708?page=3Dcom.atl= assian.jira.plugin.system.issuetabpanels:all-tabpanel ] Idan Sheinberg updated HTTPCLIENT-1708: --------------------------------------- Description:=20 Hey Guys Trying to send an httpclient HttpHead request for the following url - 'htt= p://some.domain.com/amnetcanadaplatform/HomeDe=CC=81pot_E=CC=81lectros_WEB2= 2s_video.mp4' I Notice it gets escaped as 'http://some.domain.com/amnetcanadaplatform/Hom= eD%C3%A9pot_%C3%89lectros_WEB22s_video.mp4' While other programs/utilities/frameworks expect it to be 'http://some.doma= in.com/amnetcanadaplatform/HomeDe%CC%81pot_E%CC%81lectros_WEB22s_video.mp4' I've done some digging up the source code and tracked the issue down to "= toASCIIString()" of the Java URI ( WHICH OF COURSE IS NOT YOUR RESPONSIBILI= TY )object being called in order to retrieve the request line Class : org.apache.http.client.methods.HttpRequestWrapper Method : getRequestLine()=20 Line : 113 Internally the line 'String ns =3D Normalizer.normalize(s, Normalizer.Form.= NFC);' manipulates the chars so their unicode value changes , which causes = the 'inappropriate' values to be displayed for the escaped URI=20 Class : java.net.URI Method : encode(String s) Line : 2723 Now I know this would extra hard to even get to a point where I find out if= this is a java language issue , but I don't believe unicode manipulation = of bytes is a desired behavior for url encoding. Is there any known specif= ic why you used the "toASCIIString()" method instead of the plain "toString= ()" method Do you think there's a chance this issue can be resolved on your end ? was: Hey Guys Trying to send an httpclient HttpHead request for the following url - 'htt= p://cdn.adap.tv/amnetcanadaplatform/HomeDe=CC=81pot_E=CC=81lectros_WEB22s_F= R_COMPRESSED-12142015112448-280.mp4' I Notice it gets escaped as 'http://cdn.adap.tv/amnetcanadaplatform/HomeD%C= 3%A9pot_%C3%89lectros_WEB22s_FR_COMPRESSED-12142015112448-280.mp4' While other programs/utilities/frameworks expect it to be 'http://cdn.adap.= tv/amnetcanadaplatform/HomeDe%CC%81pot_E%CC%81lectros_WEB22s_FR_COMPRESSED-= 12142015112448-280.mp4' I've done some digging up the source code and tracked the issue down to "= toASCIIString()" of the Java URI object being called in order to retrieve t= he request line > Issues With Extended ASCII ( Latin Chars ) Escaping with HttpClient 4.5.1 > ------------------------------------------------------------------------- > > Key: HTTPCLIENT-1708 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-170= 8 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: HttpClient > Affects Versions: 4.5.1 > Environment: Ubuntu Variant 15.04 > Netbeans 8.1 IDE > Java 8 ( Oracle JDK 1.8.6x) > Reporter: Idan Sheinberg > > Hey Guys > Trying to send an httpclient HttpHead request for the following url - 'h= ttp://some.domain.com/amnetcanadaplatform/HomeDe=CC=81pot_E=CC=81lectros_WE= B22s_video.mp4' > I Notice it gets escaped as 'http://some.domain.com/amnetcanadaplatform/H= omeD%C3%A9pot_%C3%89lectros_WEB22s_video.mp4' > While other programs/utilities/frameworks expect it to be 'http://some.do= main.com/amnetcanadaplatform/HomeDe%CC%81pot_E%CC%81lectros_WEB22s_video.mp= 4' > I've done some digging up the source code and tracked the issue down to = "toASCIIString()" of the Java URI ( WHICH OF COURSE IS NOT YOUR RESPONSIBI= LITY )object being called in order to retrieve the request line > Class : org.apache.http.client.methods.HttpRequestWrapper > Method : getRequestLine()=20 > Line : 113 > Internally the line 'String ns =3D Normalizer.normalize(s, Normalizer.For= m.NFC);' manipulates the chars so their unicode value changes , which cause= s the 'inappropriate' values to be displayed for the escaped URI=20 > Class : java.net.URI > Method : encode(String s) > Line : 2723 > Now I know this would extra hard to even get to a point where I find out = if this is a java language issue , but I don't believe unicode manipulation= of bytes is a desired behavior for url encoding. Is there any known spec= ific why you used the "toASCIIString()" method instead of the plain "toStri= ng()" method > Do you think there's a chance this issue can be resolved on your end ? -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org