-(defun est-uri-decode-feature-name-body (uri-feature)
- (let ((len (length uri-feature))
- (i 0)
- ch dest)
- (while (< i len)
- (setq dest
- (concat
- dest
- (if (eq (aref uri-feature i) ?\.)
- (if (and (< (+ i 2) len)
- (eq (aref uri-feature (+ i 2)) ?\.))
- (prog1
- (cond
- ((eq (setq ch (aref uri-feature (1+ i))) ?\.)
- "/")
- ((eq ch ?-)
- "*")
- (t
- (substring uri-feature i (+ i 3))
- ))
- (setq i (+ i 3)))
- (setq i (1+ i))
- ".")
- (prog1
- (char-to-string (aref uri-feature i))
- (setq i (1+ i)))))))
- dest))
-
-(defun est-uri-encode-feature-name-body (feature)
- (mapconcat (lambda (c)
- (cond ((eq c ?*)
- ".-.")
- ((eq c ?/)
- "...")
- (t (char-to-string c))))
- feature ""))
-
-(defun www-uri-decode-feature-name (uri-feature)
- (let (feature)
- (setq uri-feature (decode-uri-string uri-feature 'utf-8-mcs-er))
- (cond
- ((string-match "^from\\." uri-feature)
- (intern (format "<-%s"
- (est-uri-decode-feature-name-body
- (substring uri-feature (match-end 0)))))
- )
- ((string-match "^to\\." uri-feature)
- (intern (format "->%s"
- (est-uri-decode-feature-name-body
- (substring uri-feature (match-end 0)))))
- )
- ((string-match "^rep\\." uri-feature)
- (intern (format "=%s"
- (est-uri-decode-feature-name-body
- (substring uri-feature (match-end 0)))))
- )
- ((string-match "^rep[2i]\\." uri-feature)
- (intern (format "===%s"
- (est-uri-decode-feature-name-body
- (substring uri-feature (match-end 0)))))
- )
- ((string-match "^g\\." uri-feature)
- (intern (format "=>>%s"
- (est-uri-decode-feature-name-body
- (substring uri-feature (match-end 0)))))
- )
- ((string-match "^g[i2]\\." uri-feature)
- (intern (format "==%s"
- (est-uri-decode-feature-name-body
- (substring uri-feature (match-end 0)))))
- )
- ((string-match "^gi\\([0-9]+\\)\\." uri-feature)
- (intern (format "=>>%s%s"
- (make-string (string-to-int
- (match-string 1 uri-feature))
- ?>)
- (est-uri-decode-feature-name-body
- (substring uri-feature (match-end 0)))))
- )
- ((string-match "^o\\." uri-feature)
- (intern (format "=+>%s"
- (est-uri-decode-feature-name-body
- (substring uri-feature (match-end 0)))))
- )
- ((string-match "^a\\." uri-feature)
- (intern (format "=>%s"
- (est-uri-decode-feature-name-body
- (substring uri-feature (match-end 0)))))
- )
- ((string-match "^a\\([0-9]+\\)\\." uri-feature)
- (intern (format "%s>%s"
- (make-string (string-to-int
- (match-string 1 uri-feature))
- ?=)
- (est-uri-decode-feature-name-body
- (substring uri-feature (match-end 0)))))
- )
- ((and (setq uri-feature (est-uri-decode-feature-name-body uri-feature))
- (setq feature (intern (format "=>%s" uri-feature)))
- (find-charset feature))
- feature)
- ((and (setq feature (intern (format "=>>%s" uri-feature)))
- (find-charset feature))
- feature)
- ((and (setq feature (intern (format "=>>>%s" uri-feature)))
- (find-charset feature))
- feature)
- ((and (setq feature (intern (format "=%s" uri-feature)))
- (find-charset feature))
- feature)
- (t (intern uri-feature)))))
-
-(defun www-uri-encode-feature-name (feature-name)
- (setq feature-name (symbol-name feature-name))
- (cond
- ((string-match "^=\\+>\\([^=>]+\\)" feature-name)
- (concat "o."
- (est-uri-encode-feature-name-body
- (substring feature-name (match-beginning 1))))
- )
- ((string-match "^=\\([^=>]+\\)" feature-name)
- (concat "rep."
- (est-uri-encode-feature-name-body
- (substring feature-name (match-beginning 1))))
- )
- ((string-match "^==\\([^=>]+\\)" feature-name)
- (concat "g2."
- (est-uri-encode-feature-name-body
- (substring feature-name (match-beginning 1))))
- )
- ((string-match "^===\\([^=>]+\\)" feature-name)
- (concat "repi."
- (est-uri-encode-feature-name-body
- (substring feature-name (match-beginning 1))))
- )
- ((string-match "^=>>\\([^=>]+\\)" feature-name)
- (concat "g."
- (est-uri-encode-feature-name-body
- (substring feature-name (match-beginning 1))))
- )
- ((string-match "^=>>>\\([^=>]+\\)" feature-name)
- (concat "gi."
- (est-uri-encode-feature-name-body
- (substring feature-name (match-beginning 1))))
- )
- ((string-match "^=>>\\(>+\\)" feature-name)
- (format "gi%d.%s"
- (length (match-string 1 feature-name))
- (est-uri-encode-feature-name-body
- (substring feature-name (match-end 1))))
- )
- ((string-match "^=>\\([^=>]+\\)" feature-name)
- (concat "a."
- (est-uri-encode-feature-name-body
- (substring feature-name (match-beginning 1))))
- )
- ((string-match "^\\(=+\\)>" feature-name)
- (format "a%d.%s"
- (length (match-string 1 feature-name))
- (est-uri-encode-feature-name-body
- (substring feature-name (match-end 0))))
- )
- ((string-match "^->" feature-name)
- (concat "to."
- (est-uri-encode-feature-name-body
- (substring feature-name (match-end 0))))
- )
- ((string-match "^<-" feature-name)
- (concat "from."
- (est-uri-encode-feature-name-body
- (substring feature-name (match-end 0))))
- )
- (t (est-uri-encode-feature-name-body feature-name))))
+;; (defun est-uri-decode-feature-name-body (uri-feature)
+;; (let ((len (length uri-feature))
+;; (i 0)
+;; ch dest)
+;; (while (< i len)
+;; (setq dest
+;; (concat
+;; dest
+;; (if (eq (aref uri-feature i) ?\.)
+;; (if (and (< (+ i 2) len)
+;; (eq (aref uri-feature (+ i 2)) ?\.))
+;; (prog1
+;; (cond
+;; ((eq (setq ch (aref uri-feature (1+ i))) ?\.)
+;; "/")
+;; ((eq ch ?-)
+;; "*")
+;; ((eq ch ?_)
+;; "+")
+;; (t
+;; (substring uri-feature i (+ i 3))
+;; ))
+;; (setq i (+ i 3)))
+;; (setq i (1+ i))
+;; ".")
+;; (prog1
+;; (char-to-string (aref uri-feature i))
+;; (setq i (1+ i)))))))
+;; dest))
+
+;; (defun est-uri-encode-feature-name-body (feature)
+;; (mapconcat (lambda (c)
+;; (cond ((eq c ?*)
+;; ".-.")
+;; ((eq c ?/)
+;; "...")
+;; ((eq c ?+)
+;; "._.")
+;; (t (char-to-string c))))
+;; feature ""))
+
+;; (defun www-uri-decode-feature-name (uri-feature)
+;; (let (feature)
+;; (setq uri-feature (decode-uri-string uri-feature 'utf-8-mcs-er))
+;; (cond
+;; ((string-match "^from\\." uri-feature)
+;; (intern (format "<-%s"
+;; (est-uri-decode-feature-name-body
+;; (substring uri-feature (match-end 0)))))
+;; )
+;; ((string-match "^to\\." uri-feature)
+;; (intern (format "->%s"
+;; (est-uri-decode-feature-name-body
+;; (substring uri-feature (match-end 0)))))
+;; )
+;; ((string-match "^rep\\." uri-feature)
+;; (intern (format "=%s"
+;; (est-uri-decode-feature-name-body
+;; (substring uri-feature (match-end 0)))))
+;; )
+;; ((string-match "^rep[2i]\\." uri-feature)
+;; (intern (format "===%s"
+;; (est-uri-decode-feature-name-body
+;; (substring uri-feature (match-end 0)))))
+;; )
+;; ((string-match "^g\\." uri-feature)
+;; (intern (format "=>>%s"
+;; (est-uri-decode-feature-name-body
+;; (substring uri-feature (match-end 0)))))
+;; )
+;; ((string-match "^g[i2]\\." uri-feature)
+;; (intern (format "==%s"
+;; (est-uri-decode-feature-name-body
+;; (substring uri-feature (match-end 0)))))
+;; )
+;; ((string-match "^gi\\([0-9]+\\)\\." uri-feature)
+;; (intern (format "=>>%s%s"
+;; (make-string (string-to-int
+;; (match-string 1 uri-feature))
+;; ?>)
+;; (est-uri-decode-feature-name-body
+;; (substring uri-feature (match-end 0)))))
+;; )
+;; ((string-match "^o\\." uri-feature)
+;; (intern (format "=+>%s"
+;; (est-uri-decode-feature-name-body
+;; (substring uri-feature (match-end 0)))))
+;; )
+;; ((string-match "^a\\." uri-feature)
+;; (intern (format "=>%s"
+;; (est-uri-decode-feature-name-body
+;; (substring uri-feature (match-end 0)))))
+;; )
+;; ((string-match "^a\\([0-9]+\\)\\." uri-feature)
+;; (intern (format "%s>%s"
+;; (make-string (string-to-int
+;; (match-string 1 uri-feature))
+;; ?=)
+;; (est-uri-decode-feature-name-body
+;; (substring uri-feature (match-end 0)))))
+;; )
+;; ((and (setq uri-feature (est-uri-decode-feature-name-body uri-feature))
+;; (setq feature (intern (format "=>%s" uri-feature)))
+;; (find-charset feature))
+;; feature)
+;; ((and (setq feature (intern (format "=>>%s" uri-feature)))
+;; (find-charset feature))
+;; feature)
+;; ((and (setq feature (intern (format "=>>>%s" uri-feature)))
+;; (find-charset feature))
+;; feature)
+;; ((and (setq feature (intern (format "=%s" uri-feature)))
+;; (find-charset feature))
+;; feature)
+;; (t (intern uri-feature)))))
+
+;; (defun www-uri-encode-feature-name (feature-name)
+;; (setq feature-name (symbol-name feature-name))
+;; (cond
+;; ((string-match "^=\\+>\\([^=>]+\\)" feature-name)
+;; (concat "o."
+;; (est-uri-encode-feature-name-body
+;; (substring feature-name (match-beginning 1))))
+;; )
+;; ((string-match "^=\\([^=>]+\\)" feature-name)
+;; (concat "rep."
+;; (est-uri-encode-feature-name-body
+;; (substring feature-name (match-beginning 1))))
+;; )
+;; ((string-match "^==\\([^=>]+\\)" feature-name)
+;; (concat "g2."
+;; (est-uri-encode-feature-name-body
+;; (substring feature-name (match-beginning 1))))
+;; )
+;; ((string-match "^===\\([^=>]+\\)" feature-name)
+;; (concat "repi."
+;; (est-uri-encode-feature-name-body
+;; (substring feature-name (match-beginning 1))))
+;; )
+;; ((string-match "^=>>\\([^=>]+\\)" feature-name)
+;; (concat "g."
+;; (est-uri-encode-feature-name-body
+;; (substring feature-name (match-beginning 1))))
+;; )
+;; ((string-match "^=>>>\\([^=>]+\\)" feature-name)
+;; (concat "gi."
+;; (est-uri-encode-feature-name-body
+;; (substring feature-name (match-beginning 1))))
+;; )
+;; ((string-match "^=>>\\(>+\\)" feature-name)
+;; (format "gi%d.%s"
+;; (length (match-string 1 feature-name))
+;; (est-uri-encode-feature-name-body
+;; (substring feature-name (match-end 1))))
+;; )
+;; ((string-match "^=>\\([^=>]+\\)" feature-name)
+;; (concat "a."
+;; (est-uri-encode-feature-name-body
+;; (substring feature-name (match-beginning 1))))
+;; )
+;; ((string-match "^\\(=+\\)>" feature-name)
+;; (format "a%d.%s"
+;; (length (match-string 1 feature-name))
+;; (est-uri-encode-feature-name-body
+;; (substring feature-name (match-end 0))))
+;; )
+;; ((string-match "^->" feature-name)
+;; (concat "to."
+;; (est-uri-encode-feature-name-body
+;; (substring feature-name (match-end 0))))
+;; )
+;; ((string-match "^<-" feature-name)
+;; (concat "from."
+;; (est-uri-encode-feature-name-body
+;; (substring feature-name (match-end 0))))
+;; )
+;; (t (est-uri-encode-feature-name-body feature-name))))