From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Zhang Wei Newsgroups: gmane.emacs.devel Subject: emacs-unicode-2: miscellaneous addendum for coding system gbk and gb18030 Date: Tue, 21 Nov 2006 02:51:44 +0800 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1164049270 11388 80.91.229.2 (20 Nov 2006 19:01:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 20 Nov 2006 19:01:10 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 20 20:01:03 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GmENz-0004we-Tj for ged-emacs-devel@m.gmane.org; Mon, 20 Nov 2006 20:00:56 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GmENz-0002fX-Ap for ged-emacs-devel@m.gmane.org; Mon, 20 Nov 2006 14:00:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GmENe-0002Zb-64 for emacs-devel@gnu.org; Mon, 20 Nov 2006 14:00:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GmENb-0002VY-5j for emacs-devel@gnu.org; Mon, 20 Nov 2006 14:00:31 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GmENZ-0002UU-4b for emacs-devel@gnu.org; Mon, 20 Nov 2006 14:00:29 -0500 Original-Received: from [64.233.184.226] (helo=wr-out-0506.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GmENY-0005YE-2H for emacs-devel@gnu.org; Mon, 20 Nov 2006 14:00:28 -0500 Original-Received: by wr-out-0506.google.com with SMTP id i12so367178wra for ; Mon, 20 Nov 2006 11:00:27 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:to:subject:from:mail-followup-to:date:message-id:user-agent:mime-version:content-type; b=urIhBPWmp/A4SaQbLJWNtQuKtNbsercFh1JLN2WKYaNOc+dAKlygejl8yGE54Ss3nvxutzsSVMqf/v8yzF86aqSRSe3cVRFyKoMWuG7vZYa6CHotQR1hJz3jVMJmi7CfnJ+WPV2jv4OmwrMmuUOpdrdDH2Wxwxifz1KZHJVYLAc= Original-Received: by 10.100.164.14 with SMTP id m14mr780445ane.1164049226550; Mon, 20 Nov 2006 11:00:26 -0800 (PST) Original-Received: from brep ( [59.66.78.105]) by mx.google.com with ESMTP id 8sm13146983wrl.2006.11.20.10.59.46; Mon, 20 Nov 2006 11:00:25 -0800 (PST) Original-To: emacs-devel@gnu.org Mail-Followup-To: emacs-devel@gnu.org User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:62570 Archived-At: --=-=-= The gbk and gb18030 coding system support is added in emacs-unicode-2, Emacs 22 doesn't support them, so miscellaneous code must be added here and there, I gathered some patches and hope them useful. --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline; filename=gbk-gb18030-patch.txt Content-Transfer-Encoding: quoted-printable * local directory is at emacs@sv.gnu.org/emacs--unicode--0--patch-135 * comparing to emacs@sv.gnu.org/emacs--unicode--0--patch-135 A gbk-gb18030-patch M lisp/faces.el M lisp/international/characters.el M lisp/gnus/mm-util.el M lisp/gnus/rfc2047.el M lisp/international/mule-cmds.el M lisp/language/chinese.el M lisp/international/fontset.el * modified files --- orig/lisp/faces.el +++ mod/lisp/faces.el @@ -81,11 +81,11 @@ (defcustom face-font-registry-alternatives (if (eq system-type 'windows-nt) '(("iso8859-1" "ms-oemlatin") - ("gb2312.1980" "gb2312") + ("gb2312.1980" "gb2312" "gbk" "gb18030") ("jisx0208.1990" "jisx0208.1983" "jisx0208.1978") ("ksc5601.1989" "ksx1001.1992" "ksc5601.1987") ("muletibetan-2" "muletibetan-0")) - '(("gb2312.1980" "gb2312.80&gb8565.88" "gbk*") + '(("gb2312.1980" "gb2312.80&gb8565.88" "gbk" "gb18030") ("jisx0208.1990" "jisx0208.1983" "jisx0208.1978") ("ksc5601.1989" "ksx1001.1992" "ksc5601.1987") ("muletibetan-2" "muletibetan-0"))) --- orig/lisp/gnus/mm-util.el +++ mod/lisp/gnus/mm-util.el @@ -443,6 +443,10 @@ (iso-2022-jp latin-jisx0201 japanese-jisx0208 japanese-jisx0208-1978) (euc-kr korean-ksc5601) (gb2312 chinese-gb2312) + (gbk chinese-gbk) + (gb18030 gb18030-2-byte + gb18030-4-byte-bmp gb18030-4-byte-smp + gb18030-4-byte-ext-1 gb18030-4-byte-ext-2) (big5 chinese-big5-1 chinese-big5-2) (tibetan tibetan) (thai-tis620 thai-tis620) --- orig/lisp/gnus/rfc2047.el +++ mod/lisp/gnus/rfc2047.el @@ -107,6 +107,8 @@ (iso-2022-jp . B) (iso-2022-kr . B) (gb2312 . B) + (gbk . B) + (gb18030 . B) (big5 . B) (cn-big5 . B) (cn-gb . B) --- orig/lisp/international/characters.el +++ mod/lisp/international/characters.el @@ -834,12 +834,16 @@ (cyrillic-iso8859-5 . cyrillic-iso-8bit) (latin-iso8859-9 . iso-latin-5) (japanese-jisx0208-1978 . iso-2022-jp) - (chinese-gb2312 . cn-gb-2312) + (chinese-gb2312 . chinese-iso-8bit) + (chinese-gbk . chinese-gbk) + (gb18030-2-byte . chinese-gb18030) + (gb18030-4-byte-bmp . chinese-gb18030) + (gb18030-4-byte-smp . chinese-gb18030) + (gb18030-4-byte-ext-1 . chinese-gb18030) + (gb18030-4-byte-ext-2 . chinese-gb18030) (japanese-jisx0208 . iso-2022-jp) (korean-ksc5601 . iso-2022-kr) (japanese-jisx0212 . iso-2022-jp) - (chinese-cns11643-1 . iso-2022-cn) - (chinese-cns11643-2 . iso-2022-cn) (chinese-big5-1 . chinese-big5) (chinese-big5-2 . chinese-big5) (chinese-sisheng . iso-2022-7bit) @@ -854,6 +858,8 @@ (indian-glyph . devanagari) (tibetan-1-column . tibetan) (ethiopic . iso-2022-7bit) + (chinese-cns11643-1 . iso-2022-cn) + (chinese-cns11643-2 . iso-2022-cn) (chinese-cns11643-3 . iso-2022-cn) (chinese-cns11643-4 . iso-2022-cn) (chinese-cns11643-5 . iso-2022-cn) --- orig/lisp/international/fontset.el +++ mod/lisp/international/fontset.el @@ -50,6 +50,7 @@ ("iso8859-15$" . iso-8859-15) ("gb2312.1980" . chinese-gb2312) ("gbk" . chinese-gbk) + ("gb18030" . gb18030) ("jisx0208.1978" . japanese-jisx0208-1978) ("jisx0208" . japanese-jisx0208) ("jisx0201" . jisx0201) @@ -306,6 +307,7 @@ (nil . "CNS11643.1992-6") (nil . "CNS11643.1992-7") (nil . "gbk-0") + (nil . "gb18030") (nil . "JISX0213.2000-1") (nil . "JISX0213.2000-2") (nil . "JISX0213.2004-1")) @@ -323,6 +325,7 @@ (nil . "CNS11643.1992-6") (nil . "CNS11643.1992-7") (nil . "gbk-0") + (nil . "gb18030") (nil . "JISX0213.2000-1") (nil . "JISX0213.2000-2")) =20 @@ -363,6 +366,8 @@ =20 ;; Fallback fonts (nil (nil . "gb2312.1980") + (nil . "gbk-0") + (nil . "gb18030") (nil . "jisx0208") (nil . "ksc5601.1987") (nil . "CNS11643.1992-1") @@ -515,11 +520,11 @@ =20 ;; Setting for suppressing XLoadQueryFont on big fonts. (setq x-pixel-size-width-font-regexp - "gb2312\\|jisx0208\\|ksc5601\\|cns11643\\|big5") + "gb2312\\|gbk\\|gb18030\\|jisx0208\\|ksc5601\\|cns11643\\|big5") =20 ;; These fonts require vertical centering. (setq vertical-centering-font-regexp - "gb2312\\|jisx0208\\|jisx0212\\|ksc5601\\|cns11643\\|big5") + "gb2312\\|gbk\\|gb18030\\|jisx0208\\|jisx0212\\|ksc5601\\|cns11643\\= |big5") =20 ;; CDAC fonts are actually smaller than their design sizes. (setq face-font-rescale-alist @@ -723,6 +728,11 @@ (katakana-jisx0201 . kana) (chinese-gb2312 . han) (chinese-gbk . han) + (gb18030-2-byte . han) + (gb18030-4-byte-bmp . han) + (gb18030-4-byte-ext-1 . han) + (gb18030-4-byte-ext-2 . han) + (gb18030-4-byte-smp . han) (chinese-big5-1 . han) (chinese-big5-2 . han) (chinese-cns11643-1 . han) --- orig/lisp/international/mule-cmds.el +++ mod/lisp/international/mule-cmds.el @@ -2262,8 +2262,8 @@ ("zh_CN.GB2312" "Chinese-GB") ("zh_CN.GBK" "Chinese-GBK") ("zh_CN.GB18030" "Chinese-GB18030") - ("zh_CN" . "Chinese-GB") - ("zh" . "Chinese-GB") + ("zh_CN" . "Chinese-GBK") + ("zh" . "Chinese-GBK") ("zu" . "Latin-1") ; Zulu =20 ;; ISO standard locales @@ -2281,7 +2281,7 @@ ("sp" . "Cyrillic-ISO") ; Serbian (Cyrillic alphabet), e.g. X11R6.4 ("su" . "Latin-1") ; Finnish, e.g. Solaris 2.6 ("jp" . "Japanese") ; e.g. MS Windows - ("chs" . "Chinese-GB") ; MS Windows Chinese Simplified + ("chs" . "Chinese-GBK") ; MS Windows Chinese Simplified ("cht" . "Chinese-BIG5") ; MS Windows Chinese Traditional ("gbz" . "UTF-8") ; MS Windows Dari Persian ("div" . "UTF-8") ; MS Windows Divehi (Maldives) --- orig/lisp/language/chinese.el +++ mod/lisp/language/chinese.el @@ -91,7 +91,6 @@ (define-coding-system-alias 'euc-cn 'chinese-iso-8bit) (define-coding-system-alias 'cn-gb 'chinese-iso-8bit) (define-coding-system-alias 'gb2312 'chinese-iso-8bit) -(define-coding-system-alias 'cp936 'chinese-iso-8bit) =20 (define-coding-system 'chinese-hz "Hz/ZW 7-bit encoding for Chinese GB2312 (MIME:HZ-GB-2312)." @@ -233,7 +232,8 @@ (input-method . "chinese-py-punct") ; fixme? (sample-text . "Chinese (=E4=B8=AD=E6=96=87,=E6=99=AE=E9=80=9A=E8=AF=9D= ,=E6=B1=89=E8=AF=AD) =E5=A6=B3=E5=A5=BD") (features china-util) - (documentation . "Support for Chinese GBK character set.")) + (documentation . "Support for Chinese GBK character set.") + (tutorial . "TUTORIAL.cn")) '("Chinese")) =20 ;;; Chinese GB18030 @@ -255,9 +255,11 @@ (coding-priority gb18030 gbk iso-2022-cn chinese-big5 chinese-iso-8bit) ; fixme? (input-method . "chinese-py-punct") ; fixme? + (sample-text . "Chinese (=E4=B8=AD=E6=96=87,=E6=99=AE=E9=80=9A=E8= =AF=9D,=E6=B1=89=E8=AF=AD) =E4=BD=A0=E5=A5=BD") (features china-util) - (documentation - . "Support for Chinese GB18030 character set.")) + (documentation=20 + . "Support for Chinese GB18030 character set.") + (tutorial . "TUTORIAL.cn")) '("Chinese")) =20 ;; Fixme: add HKSCS --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --=-=-=--