Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: markspace Newsgroups: comp.lang.java.programmer Subject: Re: [LONG] java.net.URI encoding weirdness Date: Tue, 06 May 2014 13:01:46 -0700 Organization: A noiseless patient Spider Lines: 21 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 6 May 2014 20:01:49 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="9358cda03e1e0dfd3c4b757daa608707"; logging-data="17846"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18/ME1hGrkWtdUyEgnXfiwFelmDeqwHsxQ=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 In-Reply-To: Cancel-Lock: sha1:4Edpw42lUt749zxhDvUttMxHmgg= Xref: csiph.com comp.lang.java.programmer:28403 On 5/6/2014 12:29 PM, Steven Simpson wrote: > > The name of the first parameter is "param=1", and its value is "value&1". > > The name of the second parameter is "param?2", with the value "value$2 Yes, mistake on my part. I made a quick test that appeared to work, so I posted it. Mea culpa. > % java URITest4 > http://server1/path?param%3D1=value%261¶m%3F2=value%232#fragment > Query: param=1=value&1¶m?2=value#2 > Raw query: param%3D1=value%261¶m%3F2=value%232 > > This shows that getQuery() is not useful, as it decodes too soon. The Yup, see my post about 5 minutes just before yours. Clearly that's the problem, the query can't possibly be parsed as a single long string. It's a bug.