You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@abdera.apache.org by Dan Diephouse <da...@mulesource.com> on 2007/10/08 21:46:06 UTC
Roundtrip IRI escaping
I have some encoded spaces in my IRIs and I was wondering if the
behavior below was expected:
IRI iri = new IRI("./bar%20baz");
assertEquals("./bar%20baz", iri.toString());
IRI iri2 = new IRI("http://foo.com").resolve(iri);
assertEquals("http://foo.com/foo/bar%20baz", iri.toString()); // This is
what I was expecting
The actual string on the last one is "http://foo.com/foo/bar baz". Is
this expected? It makes using the abdera client a little tricky as I
can't just resolve() my href, then pass off the iri2.toString() to the
client.
Cheers,
- Dan
--
Dan Diephouse
MuleSource
http://mulesource.com | http://netzooid.com/blog
Re: Roundtrip IRI escaping
Posted by Dan Diephouse <da...@mulesource.com>.
OK thanks. Filed a JIRA so this doesn't get lost:
https://issues.apache.org/jira/browse/ABDERA-72
- Dan
James M Snell wrote:
> Try iri.toASCIIString(). I agree it's a little odd. I've been wanting to
> refactor the IRI class impl at some point.
>
> - James
>
> Dan Diephouse wrote:
>
>> I have some encoded spaces in my IRIs and I was wondering if the
>> behavior below was expected:
>>
>> IRI iri = new IRI("./bar%20baz");
>> assertEquals("./bar%20baz", iri.toString());
>> IRI iri2 = new IRI("http://foo.com").resolve(iri);
>> assertEquals("http://foo.com/foo/bar%20baz", iri.toString()); // This is
>> what I was expecting
>> The actual string on the last one is "http://foo.com/foo/bar baz".
>> Is this expected? It makes using the abdera client a little tricky as I
>> can't just resolve() my href, then pass off the iri2.toString() to the
>> client.
>>
>> Cheers,
>> - Dan
>>
>>
--
Dan Diephouse
MuleSource
http://mulesource.com | http://netzooid.com/blog
Re: Roundtrip IRI escaping
Posted by James M Snell <ja...@gmail.com>.
Try iri.toASCIIString(). I agree it's a little odd. I've been wanting to
refactor the IRI class impl at some point.
- James
Dan Diephouse wrote:
> I have some encoded spaces in my IRIs and I was wondering if the
> behavior below was expected:
>
> IRI iri = new IRI("./bar%20baz");
> assertEquals("./bar%20baz", iri.toString());
> IRI iri2 = new IRI("http://foo.com").resolve(iri);
> assertEquals("http://foo.com/foo/bar%20baz", iri.toString()); // This is
> what I was expecting
> The actual string on the last one is "http://foo.com/foo/bar baz".
> Is this expected? It makes using the abdera client a little tricky as I
> can't just resolve() my href, then pass off the iri2.toString() to the
> client.
>
> Cheers,
> - Dan
>