From: MORIOKA Tomohiko Date: Fri, 6 Jun 2014 02:34:13 +0000 (+0900) Subject: (www-uri-decode-feature-name): Decode `rep2.FOO' to `==FOO'. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=cde41f979d64d5994521da7f66c049797fd89de0;p=chise%2Fest.git (www-uri-decode-feature-name): Decode `rep2.FOO' to `==FOO'. (www-uri-encode-feature-name): Encode `==FOO' to `rep2.FOO'. (www-format-encode-string): Support `==cns11643-*'; support `==gt' and `==ucs@unicode'. --- diff --git a/cwiki-common.el b/cwiki-common.el index 24440bd..c7d8335 100644 --- a/cwiki-common.el +++ b/cwiki-common.el @@ -314,6 +314,9 @@ ((string-match "^rep\\." uri-feature) (intern (format "=%s" (substring uri-feature (match-end 0)))) ) + ((string-match "^rep2\\." uri-feature) + (intern (format "==%s" (substring uri-feature (match-end 0)))) + ) ((string-match "^g\\." uri-feature) (intern (format "=>>%s" (substring uri-feature (match-end 0)))) ) @@ -363,6 +366,9 @@ ((string-match "^=\\([^=>]+\\)" feature-name) (concat "rep." (substring feature-name (match-beginning 1))) ) + ((string-match "^==\\([^=>]+\\)" feature-name) + (concat "rep2." (substring feature-name (match-beginning 1))) + ) ((string-match "^=>>\\([^=>]+\\)" feature-name) (concat "g." (substring feature-name (match-beginning 1))) ) @@ -659,7 +665,14 @@ '(=jef-china3 "JC3-" 4 X) '(=ucs@unicode "UU+" 4 X) '(=ucs@JP/hanazono "hanaJU+" 4 X) - '(=daikanwa "M-" 5 d) + '(=daikanwa "M-" 5 d) + '(==cns11643-1 "R-C1-" 4 X) + '(==cns11643-2 "R-C2-" 4 X) + '(==cns11643-3 "R-C3-" 4 X) + '(==cns11643-4 "R-C4-" 4 X) + '(==cns11643-5 "R-C5-" 4 X) + '(==cns11643-6 "R-C6-" 4 X) + '(==cns11643-7 "R-C7-" 4 X) coded-charset-entity-reference-alist))) (encode-coding-region (point-min)(point-max) 'utf-8-mcs-er) @@ -746,9 +759,9 @@ style=\"%s\">" t 'literal)) (goto-char (point-min)) - (while (re-search-forward "&C\\([1-7]\\)-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t) - (setq plane (string-to-int (match-string 1)) - code (string-to-int (match-string 2) 16)) + (while (re-search-forward "&\\(R-\\)?C\\([1-7]\\)-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t) + (setq plane (string-to-int (match-string 2)) + code (string-to-int (match-string 3) 16)) (replace-match (format "\"CNS%d-%04X\"" @@ -791,7 +804,7 @@ style=\"vertical-align:middle\">" t 'literal)) (goto-char (point-min)) - (while (re-search-forward "&\\(G-\\|g2-\\)?GT-\\([0-9]+\\);" nil t) + (while (re-search-forward "&\\(G-\\|R-\\|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 "&\\(A-\\)?\\(UU\\+\\|U-\\)\\([0-9A-F]+\\);" nil t) + (while (re-search-forward "&\\(A-\\|R-\\)?\\(UU\\+\\|U-\\)\\([0-9A-F]+\\);" nil t) (setq code (string-to-int (match-string 3) 16)) (replace-match (format "