* module/web/uri.scm (uri-encode): Change test to check for unreserved
chars instead of reserved chars.
* test-suite/tests/web-uri.test ("encode"): Add test.
within the given @var{encoding}, then encodes each byte as
@code{%@var{HH}}, where @var{HH} is the hexadecimal representation of
the byte."
- (if (string-index str unescaped-chars)
+ (define (needs-escaped? ch)
+ (not (char-set-contains? unescaped-chars ch)))
+ (if (string-index str needs-escaped?)
(call-with-output-string*
(lambda (port)
(string-for-each
(with-test-prefix "encode"
(pass-if (equal? "foo%20bar" (uri-encode "foo bar")))
- (pass-if (equal? "foo%0a%00bar" (uri-encode "foo\n\x00bar"))))
+ (pass-if (equal? "foo%0a%00bar" (uri-encode "foo\n\x00bar")))
+ (pass-if (equal? "%3c%3e%5c%5e" (uri-encode "<>\\^"))))