[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: pccl



CCL は分かっていないのですが、`write-multibyte-character' を
使うと XEmacs でも化けないようです。

適当に w3m-euc-japan を基に、ari-euc-japan ってのを書いてみましたが、
jisx0208 に関しては化けないことを確認しました。

PNG image

(require 'pccl)
(require 'w3m)

(define-ccl-program ari-euc-japan-decoder
  `(2
    (loop
     (read r0)
     ;; Process normal EUC characters.
     (if (r0 < #x80)
	 (write-repeat r0))
     (if (r0 > #xa0)
	 ((read r1)
	  (r1 &= #x7f)
	  (r1 |= ((r0 & #x7f) << 7))
	  (r0 = ,(charset-id 'japanese-jisx0208))
	  (write-multibyte-character r0 r1)
	  (repeat)))
     (if (r0 == #x8e)
	 ((read r1)
	  (r0 = ,(charset-id 'katakana-jisx0201))
	  (write-multibyte-character r0 r1)
	  (repeat)))
     (if (r0 == #x8f)
	 ((read r0 r1)
	  (r1 &= #x7f)
	  (r1 |= ((r0 & #x7f) << 7))
	  (r0 = ,(charset-id 'japanese-jisx0212))
	  (write-multibyte-character r0 r1)
	  (repeat)))
     ;; Process internal characters used in w3m.
     (if (r0 == ?\x80)			; Old ANSP (w3m-0.1.11pre+kokb23)
	 (write-repeat 32))
     (if (r0 == ?\x90)			; ANSP (use for empty anchor)
	 (write-repeat 32))
     (if (r0 == ?\x91)			; IMSP (blank around image)
	 (write-repeat 32))
     (if (r0 == ?\xa0)			; NBSP (non breakble space)
	 (write-repeat 32))
     (write-repeat r0))))

(make-ccl-coding-system
 'ari-euc-japan ?E
 "ISO 2022 based EUC encoding for Japanese with w3m internal characters."
 'ari-euc-japan-decoder 'w3m-euc-japan-encoder)
-- 
有沢 明宏