From: MORIOKA Tomohiko Date: Sat, 21 Sep 2013 11:32:51 +0000 (+0900) Subject: (www-format-encode-string): Support `=hanyo-denshi/*', X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=7e2cc8708ffaffc4c7e1727aaf6299a2d9429013;p=chise%2Fest.git (www-format-encode-string): Support `=hanyo-denshi/*', `=adobe-japan1-6', `=big5-cdp', `=ucs@unicode' and `=ucs@JP/hanazono'; support &{G|g2}-J{78|83|90|97|SP}-hhhh;. (coded-charset-GlyphWiki-id-alist): Modify preference of `=>>daikanwa' and `=ucs@ks'. --- diff --git a/cwiki-common.el b/cwiki-common.el index 0bf55be..24440bd 100644 --- a/cwiki-common.el +++ b/cwiki-common.el @@ -626,6 +626,17 @@ (let ((coded-charset-entity-reference-alist (list* '(=gt "GT-" 5 d) + '(=hanyo-denshi/ja "HD-JA-" 4 X) + '(=hanyo-denshi/jb "HD-JB-" 4 X) + '(=hanyo-denshi/jc "HD-JC-" 4 X) + '(=hanyo-denshi/jd "HD-JD-" 4 X) + '(=hanyo-denshi/ft "HD-FT-" 4 X) + '(=hanyo-denshi/ia "HD-IA-" 4 X) + '(=hanyo-denshi/ib "HD-IB-" 4 X) + '(=hanyo-denshi/hg "HD-HG-" 4 X) + '(=hanyo-denshi/ip "HD-IP-" 4 X) + '(=hanyo-denshi/jt "HD-JT-" 4 X) + '(=hanyo-denshi/ks "HD-KS-" 6 d) '(=cns11643-1 "C1-" 4 X) '(=cns11643-2 "C2-" 4 X) '(=cns11643-3 "C3-" 4 X) @@ -633,6 +644,8 @@ '(=cns11643-5 "C5-" 4 X) '(=cns11643-6 "C6-" 4 X) '(=cns11643-7 "C7-" 4 X) + '(=adobe-japan1-6 "AJ1-" 5 d) + '(=big5-cdp "CDP-" 4 X) '(=gb2312 "G0-" 4 X) '(=gb12345 "G1-" 4 X) '(=jis-x0208@1990 "J90-" 4 X) @@ -644,6 +657,8 @@ '(=ruimoku-v6 "RUI6-" 4 X) '(=zinbun-oracle "ZOB-" 4 d) '(=jef-china3 "JC3-" 4 X) + '(=ucs@unicode "UU+" 4 X) + '(=ucs@JP/hanazono "hanaJU+" 4 X) '(=daikanwa "M-" 5 d) coded-charset-entity-reference-alist))) (encode-coding-region (point-min)(point-max) 'utf-8-mcs-er) @@ -661,7 +676,7 @@ style=\"%s\">" t 'literal)) (goto-char (point-min)) - (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) + (while (re-search-forward "&\\(o-\\|G-\\|g2-\\)?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 @@ -676,6 +691,46 @@ style=\"%s\">" t 'literal)) (goto-char (point-min)) + (while (re-search-forward "&\\(o-\\)?HD-\\(JA\\|JB\\|JC\\|JD\\|FT\\|IA\\|IB\\|HG\\)-\\([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 "\"HD-%s-%04X\"" + plane code + chise-wiki-bitmap-glyphs-url + plane + (- (lsh code -8) 32) + (- (logand code 255) 32) + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(o-\\|G-\\|g2-\\)?HD-\\(IP\\|JT\\)-\\([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 "\"HD-%s-%04X\"" + plane code + chise-wiki-bitmap-glyphs-url + plane code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(o-\\|G-\\|g2-\\)?HD-KS-\\([0-9]+\\);" nil t) + (setq code (string-to-int (match-string 2))) + (replace-match + (format "\"HD-KS%06d\"" + code + chise-wiki-bitmap-glyphs-url + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) (while (re-search-forward "&G\\([01]\\)-\\([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)) @@ -724,6 +779,18 @@ style=\"vertical-align:middle\">" t 'literal)) (goto-char (point-min)) + (while (re-search-forward "&\\(o-\\|G-\\|g2-\\)?AJ1-\\([0-9]+\\);" nil t) + (setq code (string-to-int (match-string 2))) + (replace-match + (format "\"AJ1-%05d\"" + code + chise-wiki-bitmap-glyphs-url + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) (while (re-search-forward "&\\(G-\\|g2-\\)?GT-\\([0-9]+\\);" nil t) (setq code (string-to-int (match-string 2))) (replace-match @@ -784,6 +851,18 @@ style=\"vertical-align:middle\">" t 'literal)) (goto-char (point-min)) + (while (re-search-forward "&hanaJU\\+\\([0-9A-F]+\\);" nil t) + (setq code (string-to-int (match-string 1) 16)) + (replace-match + (format "\"hanaJU+%04X\"" + code + chise-wiki-glyph-cgi-url + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) (while (re-search-forward "&\\(A-\\)?\\(UU\\+\\|U-\\)\\([0-9A-F]+\\);" nil t) (setq code (string-to-int (match-string 3) 16)) (replace-match @@ -894,10 +973,10 @@ style=\"vertical-align:middle\">" (=jis-x0213-2 "jx2-" 4 x nil) (=gt "gt-" 5 d nil) (=daikanwa "dkw-" 5 d nil) - (=>>daikanwa "dkw-" 5 d nil) (=gt-k "gt-k" 5 d nil) (=jef-china3 "jc3-" 4 x nil) (=big5 "b-" 4 x nil) + (=ucs@ks "u" 4 x "-k") (=ks-x1001 "k0-" 4 x nil) (=jis-x0208@1978/1pr "j78-" 4 x nil) (=jis-x0208@1978/-4pr "j78-" 4 x nil) @@ -907,7 +986,6 @@ style=\"vertical-align:middle\">" (=+>jis-x0208@1978 "j78-" 4 x nil) (=ucs@JP "u" 4 x nil) (=ucs@gb "u" 4 x "-g") - (=ucs@ks "u" 4 x "-k") (=ucs@iso "u" 4 x "-u") (=ucs@unicode "u" 4 x "-us") (=big5-cdp "cdp-" 4 x nil) @@ -932,6 +1010,7 @@ style=\"vertical-align:middle\">" (=>>jis-x0208@1983 "j83-" 4 x nil) (=+>jis-x0208@1983 "j83-" 4 x nil) (=cbeta "cb" 5 d nil) + (=>>daikanwa "dkw-" 5 d nil) )) (defun char-GlyphWiki-id (char)