From 6ce08b8e77f4399bbb4f433a3f3fb9bf5434076a Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Thu, 5 Apr 2012 18:37:22 +0900 Subject: [PATCH] (www-uri-decode-feature-name): Decode "o.foo" to `=+>foo'. (www-uri-encode-feature-name): Encode `=+>foo' to "o.foo". (www-uri-encode-object): Add `=+>jis-x0208@1978', `=>ucs@iso', `=>ucs@unicode', `=>ucs@jis', `=>ucs@cns' and `=>ucs@ks' to ccs-list. (www-format-encode-string): Support "&o-foo;", "&g2-GT-ddddd;" and "&A-{UU+|U-}hhhh(h)*;". --- cwiki-common.el | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/cwiki-common.el b/cwiki-common.el index 6e7b014..dc5ae77 100644 --- a/cwiki-common.el +++ b/cwiki-common.el @@ -310,6 +310,9 @@ ?>) (substring uri-feature (match-end 0)))) ) + ((string-match "^o\\." uri-feature) + (intern (format "=+>%s" (substring uri-feature (match-end 0)))) + ) ((string-match "^a\\." uri-feature) (intern (format "=>%s" (substring uri-feature (match-end 0)))) ) @@ -337,6 +340,9 @@ (defun www-uri-encode-feature-name (feature-name) (setq feature-name (symbol-name feature-name)) (cond + ((string-match "^=\\+>\\([^=>]+\\)" feature-name) + (concat "o." (substring feature-name (match-beginning 1))) + ) ((string-match "^=\\([^=>]+\\)" feature-name) (concat "rep." (substring feature-name (match-beginning 1))) ) @@ -428,8 +434,11 @@ =daikanwa =gt =gt-k =>>jis-x0208 =>>jis-x0213-1 + =+>jis-x0208@1978 =>jis-x0208 =>jis-x0213-1 =>>gt + =>ucs@iso =>ucs@unicode + =>ucs@jis =>ucs@cns =>ucs@ks =ruimoku-v6 =big5 =big5-cdp)) @@ -617,9 +626,9 @@ style=\"%s\">" t 'literal)) (goto-char (point-min)) - (while (re-search-forward "&J\\(78\\|83\\|90\\|97\\|SP\\)-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t) - (setq plane (match-string 1) - code (string-to-int (match-string 2) 16)) + (while (re-search-forward "&\\(o-\\)?J\\(78\\|83\\|90\\|97\\|SP\\)-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t) + (setq plane (match-string 2) + code (string-to-int (match-string 3) 16)) (replace-match (format "\"J%s-%04X\"" @@ -680,7 +689,7 @@ style=\"vertical-align:middle\">" t 'literal)) (goto-char (point-min)) - (while (re-search-forward "&\\(G-\\)?GT-\\([0-9]+\\);" nil t) + (while (re-search-forward "&\\(G-\\|g2-\\)?GT-\\([0-9]+\\);" nil t) (setq code (string-to-int (match-string 2))) (replace-match (format "\"GT-%05d\"" t 'literal)) (goto-char (point-min)) - (while (re-search-forward "&\\(UU\\+\\|U-\\)\\([0-9A-F]+\\);" nil t) - (setq code (string-to-int (match-string 2) 16)) + (while (re-search-forward "&\\(A-\\)?\\(UU\\+\\|U-\\)\\([0-9A-F]+\\);" nil t) + (setq code (string-to-int (match-string 3) 16)) (replace-match (format "\"UU+%04X\"" -- 1.7.10.4