Revision: 1.1 - (view) (download)
1 : | ktanaka | 1.1 | ;; --------- ;; |
2 : | ;; han2zen.l ;; | ||
3 : | ;; --------- ;; | ||
4 : | |||
5 : | (defun hankaku->zenkaku-sub (code) | ||
6 : | (setq code (+ code code)) | ||
7 : | (substring | ||
8 : | "¡¡¡ª¡É¡ô¡ð¡ó¡õ¡Ç¡Ê¡Ë¡ö¡Ü¡¤¡Ý¡¥¡¿£°£±£²£³£´£µ£¶£·£¸£¹¡§¡¨¡ã¡á¡ä¡©¡÷£Á£Â£Ã£Ä£Å£Æ£Ç£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡Î¡ï¡Ï¡°¡²£à£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡Ð¡Ã¡Ñ¡±" | ||
9 : | (- code 64) | ||
10 : | (- code 62))) | ||
11 : | |||
12 : | (defun zenkaku-string (str) | ||
13 : | (let ((len (string-length str)) | ||
14 : | (ret "")) | ||
15 : | (do ((i 0 (1+ i))) | ||
16 : | ((>= i len) ret) | ||
17 : | (setq ret | ||
18 : | (string-append ret | ||
19 : | (cond ((= (logand (sref str i) 128) 128) | ||
20 : | (setq i (1+ i)) | ||
21 : | (substring str (1- i) (1+ i))) | ||
22 : | (t | ||
23 : | (hankaku->zenkaku-sub (sref str i))))))))) | ||
24 : | |||
25 : | (defun num->string (num) | ||
26 : | (lets ((string (make-string 256)) | ||
27 : | (stream (string-stream string)) | ||
28 : | (standard-output (outopen stream))) | ||
29 : | (princ num) | ||
30 : | (substring string 0 (string-stream-index standard-output)))) |
ktanaka Powered by ViewCVS 1.0-dev |
ViewCVS and CVS Help |