encode/decode URIs in 'pedantic' mode (issue #3923)