From Is there some way to convert json to xml in PHP?

The link XML Serializer link encodes the _, which causes a failure on the destination site:

The requested document /package/XML%5FSerializer was not found on this server.

The link works fine here on Meta, but not within the question on SO.


The HTML indeed was <a href="http://pear.php.net/package/XML%5FSerializer" ...> for that. It's an old post and the HTML is "cooked" (cached) when a post is saved. Making a dummy edit has meanwhile fixed that HTML, just like more recent posts (like your question above) use the underscore in the HTML source.

But, that "fix" aside: I think your browser should really support it. My Chrome on a Mac has no problems following that link. However, Firefox on my Mac does fail, as it apparently sends a different URL to the web server. Chrome versus Firefox:

GET /package/XML_Serializer HTTP/1.1
Host: pear.php.net
GET /package/XML%5FSerializer HTTP/1.1
Host: pear.php.net

Wikipedia states states that the underscore is an unreserved character and does not need percent encoding (emphasis mine):

Characters from the unreserved set never need to be percent-encoded.

URIs that differ only by whether an unreserved character is percent-encoded or appears literally are equivalent by definition, but URI processors, in practice, may not always recognize this equivalence. For example, URI consumers shouldn't treat "%41" differently from "A" or "%7E" differently from "~", but some do. For maximum interoperability, URI producers are discouraged from percent-encoding unreserved characters.

I guess that's why eventually the encoding changed, though for long SE did use %5F on purpose.


The link works fine here on Meta, but not within the question on SO.

This means it was fixed already, but old posts aren't updated until they're edited. Make a tiny edit to re-cook the HTML and it should work.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .