Fixed #19508 -- Used uri_to_iri.

This is a PR for ticket #19508 for which another PR #2919 was opened by me a few days ago.
This PR implements `uri_to_iri` as per RFC and changes the `PATH_INFO` at the very time when `environ` is being set contrary to the previous one which corrected the received url from `environ`.
Ok I understand that but what has that got to do with including extra parameters.
Regarding encoding it in latin-1 when py3, I did it becuase in wsgi.py there are functions `get_bytes_from_wsgi` and `get_str_from_wsgi` which do decode in latin-1 and that is not limited to `PATH_INFO` but also other `environ` variables so in order to keep things same everywhere.