Symfony has a normalizer that could be useful for this:
https://github.com/symfony/symfony/blob/2.0/src/Symfony/Component/HttpFoundation/Request.php#method_getQueryString