(www-uri-decode-feature-name): Decode `rep2.FOO' to `==FOO'.
authorMORIOKA Tomohiko <tomo.git@chise.org>
Fri, 6 Jun 2014 02:34:13 +0000 (11:34 +0900)
committerMORIOKA Tomohiko <tomo.git@chise.org>
Fri, 6 Jun 2014 02:34:13 +0000 (11:34 +0900)
(www-uri-encode-feature-name): Encode `==FOO' to `rep2.FOO'.
(www-format-encode-string): Support `==cns11643-*'; support `==gt' and
`==ucs@unicode'.

cwiki-common.el

index 24440bd..c7d8335 100644 (file)
      ((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))))
       )
    ((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)))
     )
                '(=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 "<img alt=\"CNS%d-%04X\" src=\"%s/CNS%d/%04X.gif\"
 style=\"%s\">"
@@ -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 "<img alt=\"GT-%05d\" src=\"%s?char=GT-%05d\"
@@ -863,7 +876,7 @@ style=\"vertical-align:middle\">"
             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 "<img alt=\"UU+%04X\" src=\"http://www.unicode.org/cgi-bin/refglyph?24-%04X\"