Changeset 12915 in project


Ignore:
Timestamp:
12/29/08 14:55:12 (13 years ago)
Author:
sjamaan
Message:

Make use of uri-encode-string in join-segments; make encoded characters uppercase hexchars (as per normalization rules)

Location:
release/4/uri-generic/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/uri-generic/trunk/tests/run.scm

    r12857 r12915  
    178178
    179179(define encode/decode-cases
    180   '(("foo?bar" "foo%3fbar")
     180  '(("foo?bar" "foo%3Fbar")
    181181    ("foo&bar" "foo%26bar")
    182182    ("foo%20bar" "foo%2520bar")))
  • release/4/uri-generic/trunk/uri-generic.scm

    r12908 r12915  
    236236(define (pct-encode char-list char-set)
    237237  (define (hex-digit i)
    238     (and (>= i 0) (< i 16) (car (string->list (sprintf "~X" i)))))
     238    (and (>= i 0) (< i 16)
     239         (car (string->list (string-upcase (number->string i 16))))))
    239240  (reverse (fold (lambda (c cl)
    240241                   (if (char-set-contains? char-set c)
     
    753754  (string-intersperse
    754755   (map (lambda (segment)
    755           (string-translate* segment '(("/" . "%2F"))))
     756          (uri-encode-string segment (char-set #\/)))
    756757        segments) "/"))
    757758
Note: See TracChangeset for help on using the changeset viewer.