Update of /project/closure/cvsroot/closure/src/net In directory clnet:/tmp/cvs-serv9505/src/net
Modified Files: package.lisp url.lisp Log Message:
Use CXML's rune implementation and XML parser.
--- /project/closure/cvsroot/closure/src/net/package.lisp 2005/03/13 18:02:19 1.2 +++ /project/closure/cvsroot/closure/src/net/package.lisp 2006/12/29 21:29:29 1.3 @@ -30,7 +30,7 @@
(defpackage :ws/netlib (:nicknames :netlib) - (:use :glisp :url) + (:use :glisp :url :runes) (:export #:*options/connection-timeout* #:open-document #:with-open-document --- /project/closure/cvsroot/closure/src/net/url.lisp 2005/03/13 18:02:19 1.5 +++ /project/closure/cvsroot/closure/src/net/url.lisp 2006/12/29 21:29:29 1.6 @@ -41,7 +41,7 @@ ;(require :glisp)
(defpackage :url - (:use :glisp) + (:use :glisp :runes) (:export #:parse-url #:unparse-url @@ -206,11 +206,7 @@ (declaim (inline ascii-digit-char-p))
(defun parse-url (input &key (plain-query-p t)) - (cond ((sloopy-rod-p input) - ;; zzz use UTF-8 - (parse-url (map 'string (lambda (x) (or (code-char x) #?)) input) - :plain-query-p plain-query-p)) - ((stringp input) + (cond ((stringp input) (let ((anchor nil) (protocol nil) (net-loc nil) @@ -263,6 +259,10 @@ :path (mapcar #'unescape-string path) :query (if plain-query-p query (parse-query query)) :anchor (unescape-string anchor)) ))))) + ((sloopy-rod-p input) + ;; zzz use UTF-8 + (parse-url (map 'string (lambda (x) (or (rune-char x) #?)) input) + :plain-query-p plain-query-p)) ((eq input NIL) (warn "Saw NIL as input to URL:PARSE-URL; fix your program.") (parse-url "" :plain-query-p plain-query-p))