patching URI.decode to support UTF-8 chars in the URI; handling badly encoded URIs