Defer compililng external-formats until warm load
[sbcl.git] / src / code / external-formats / enc-cn.lisp
blob59457fc360aa60706a7df2233c7c072d92f3760a
1 ;;; enc-cn.lisp: CP936 encoding support in SBCL
2 ;;; Chun Tian (binghe) <binghe.lisp@gmail.com>
3 ;;; Sat Dec 23 02:45:12 CST 2006
5 (in-package "SB-IMPL")
7 ;;; GBK
8 (declaim (inline ucs-to-gbk gbk-to-ucs
9 mb-len-as-gbk gbk-continuation-byte-p))
11 (defun ucs-to-gbk (code)
12 (declare (optimize speed (safety 0))
13 (type fixnum code))
14 (if (<= code #x7f) code
15 (get-multibyte-mapper +ucs-to-gbk-table+ code)))
17 (defun gbk-to-ucs (code)
18 (declare (optimize speed (safety 0))
19 (type fixnum code))
20 (if (<= code #x7f) code
21 (get-multibyte-mapper +gbk-to-ucs-table+ code)))
23 (defun mb-len-as-gbk (code)
24 (declare (optimize speed (safety 0))
25 (type (unsigned-byte 8) code))
26 (if (< code #x80) 1 2))
28 (defun gbk-continuation-byte-p (code)
29 (declare (optimize speed (safety 0))
30 (type (unsigned-byte 8) code)
31 (ignore code))
34 (declaim (muffle-conditions compiler-note))
35 (define-multibyte-encoding :gbk (:gbk :cp936)
36 ucs-to-gbk gbk-to-ucs mb-len-as-gbk gbk-continuation-byte-p)