Hello,

This article:
http://blog.lunatech.com/2009/02/03/what-every-web-developer-must-know-about-url-encoding

...refers to the pitfalls of using Java's standard URLEncoder / URLDecoder
classes for anything other than *form* encoding.  In particular, it is
unsuitable for path segments, and has no concept of matrix parameters (such
as ;jsessionid=xxx but appearing in any segment).  The standard URI class
in the JDK doesn't appear to provide much in the way of solutions either.

Given that when encoding and decoding URLs/URIs, I can first split into
segments (easy enough splitting on "/"), does anyone on this HTTP client
list have any recommendations for correctly encoding and decoding each
individual path segment (and extracting matrix parameters)?  After
searching, I've found no standalone class (read: without being bloated or
loaded with dependencies) that can both encode and decode.  Given how many
implementors seem to have got it more or less wrong, I'm humble enough not
to try it myself unless there really is no other choice.

Thanks,
Christopher

Reply via email to