(chise-wiki-bitmap-glyphs-url): Renamed from `chise-wiki-glyphs-url'.
authorMORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
Thu, 18 Mar 2010 07:49:05 +0000 (16:49 +0900)
committerMORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
Thu, 18 Mar 2010 07:49:05 +0000 (16:49 +0900)
(www-format-encode-string):
- Use `chise-wiki-bitmap-glyphs-url' instead of
  `chise-wiki-glyphs-url'.
- Display &JC3-hhhh; and &ZOB-dddd;.

cwiki-common.el

index 5a8cfda..0aa7094 100644 (file)
@@ -4,8 +4,8 @@
 (defvar chise-wiki-view-url "view.cgi")
 (defvar chise-wiki-edit-url "edit/edit.cgi")
 
-(defvar chise-wiki-glyphs-url
-  "http://chise.zinbun.kyoto-u.ac.jp/glyphs/")
+(defvar chise-wiki-bitmap-glyphs-url
+  "http://chise.zinbun.kyoto-u.ac.jp/glyphs")
 
 (defun decode-uri-string (string &optional coding-system)
   (if (> (length string) 0)
            (replace-match
             (format "<img alt=\"CB%05d\" src=\"%s/cb-gaiji/%02d/CB%05d.gif\">"
                     code
-                    chise-wiki-glyphs-url
+                    chise-wiki-bitmap-glyphs-url
                     (/ code 1000) code)
             t 'literal))
 
            (replace-match
             (format "<img alt=\"J%s-%04X\" src=\"%s/JIS-%s/%02d-%02d.gif\">"
                     plane code
-                    chise-wiki-glyphs-url
+                    chise-wiki-bitmap-glyphs-url
                     plane
                     (- (lsh code -8) 32)
                     (- (logand code 255) 32))
            (replace-match
             (format "<img alt=\"GB%d-%04X\" src=\"%s/GB%d/%02d-%02d.gif\">"
                     plane code
-                    chise-wiki-glyphs-url
+                    chise-wiki-bitmap-glyphs-url
                     plane
                     (- (lsh code -8) 32)
                     (- (logand code 255) 32))
            (replace-match
             (format "<img alt=\"CNS%d-%04X\" src=\"%s/CNS%d/%04X.gif\">"
                     plane code
-                    chise-wiki-glyphs-url
+                    chise-wiki-bitmap-glyphs-url
                     plane code)
             t 'literal))
+
+         (goto-char (point-min))
+         (while (re-search-forward "&JC3-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t)
+           (setq code (string-to-int (match-string 1) 16))
+           (replace-match
+            (format "<img alt=\"JC3-%04X\" src=\"http://kanji.zinbun.kyoto-u.ac.jp/db/CHINA3/Gaiji/%04x.gif\">"
+                    code code)
+            t 'literal))
+
+         (goto-char (point-min))
+         (while (re-search-forward "&ZOB-\\([0-9]+\\);" nil t)
+           (setq code (string-to-int (match-string 1)))
+           (replace-match
+            (format "<img alt=\"ZOB-%04d\" src=\"%s/ZOB-1968/%04d.png\">"
+                    code
+                    chise-wiki-bitmap-glyphs-url
+                    code)
+            t 'literal))
          ))
       (goto-char (point-min))
       (while (search-forward "&GT-" nil t)