the scheme to lowercase if it is uppercase. Apart from
normalization, if URL is already URI-encoded, this function
should return it unchanged."
- (if (multibyte-string-p url)
- (setq url (encode-coding-string url 'utf-8)))
(let* ((obj (url-generic-parse-url url))
(user (url-user obj))
(pass (url-password obj))
- (host (url-host obj))
- (path-and-query (url-path-and-query obj))
+ (path-and-query (url-path-and-query obj))
(path (car path-and-query))
(query (cdr path-and-query))
(frag (url-target obj)))
(setf (url-user obj) (url-hexify-string user)))
(if pass
(setf (url-password obj) (url-hexify-string pass)))
- ;; No special encoding for IPv6 literals.
- (and host
- (not (string-match "\\`\\[.*\\]\\'" host))
- (setf (url-host obj)
- (decode-coding-string (url-host obj) 'utf-8)))
-
(if path
(setq path (url-hexify-string path url-path-allowed-chars)))
(if query
(should (equal (url-generic-parse-url "#") (url-parse-make-urlobj nil nil nil nil nil "" "" nil nil)))
(should (equal (url-generic-parse-url "#foo") (url-parse-make-urlobj nil nil nil nil nil "" "foo" nil nil))))
+(ert-deftest url-generic-parse-url/multibyte-host-and-path ()
+ (should (equal (url-generic-parse-url "http://банки.рф/фыва/")
+ (url-parse-make-urlobj "http" nil nil "банки.рф" nil
+ "/фыва/" nil nil t))))
+
(provide 'url-parse-tests)
;;; url-parse-tests.el ends here