From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: cp949 support Date: Thu, 18 Jun 2009 20:14:44 +0900 Message-ID: References: <861vpldwy5.fsf@nirvana.pusto.de> <9d644d9b0906170107o2e7f5d82j46882620b5a968b1@mail.gmail.com> <868wjq1szl.fsf@nirvana.pusto.de> <9d644d9b0906171919x3b05cc2eu6af3db8d113ee6cd@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1245325381 23997 80.91.229.12 (18 Jun 2009 11:43:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Jun 2009 11:43:01 +0000 (UTC) Cc: usenet@pusto.de, emacs-devel@gnu.org To: Jihyun Cho Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 18 13:42:54 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MHG17-0006LE-2O for ged-emacs-devel@m.gmane.org; Thu, 18 Jun 2009 13:42:54 +0200 Original-Received: from localhost ([127.0.0.1]:45975 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MHG16-0002rO-Fb for ged-emacs-devel@m.gmane.org; Thu, 18 Jun 2009 07:42:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MHFa7-00024d-9Z for emacs-devel@gnu.org; Thu, 18 Jun 2009 07:14:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MHFa2-00023X-HM for emacs-devel@gnu.org; Thu, 18 Jun 2009 07:14:58 -0400 Original-Received: from [199.232.76.173] (port=36859 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MHFa1-00023R-Kz for emacs-devel@gnu.org; Thu, 18 Jun 2009 07:14:53 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]:54834) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MHFa0-0008Jy-En for emacs-devel@gnu.org; Thu, 18 Jun 2009 07:14:53 -0400 Original-Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id n5IBEjuQ002578; Thu, 18 Jun 2009 20:14:46 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp1.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id n5IBEjgf019411; Thu, 18 Jun 2009 20:14:45 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp1.aist.go.jp with ESMTP id n5IBEjL0027382; Thu, 18 Jun 2009 20:14:45 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1MHFZs-0000P0-Vp; Thu, 18 Jun 2009 20:14:44 +0900 In-reply-to: <9d644d9b0906171919x3b05cc2eu6af3db8d113ee6cd@mail.gmail.com> (message from Jihyun Cho on Thu, 18 Jun 2009 11:19:05 +0900) X-detected-operating-system: by monty-python.gnu.org: Solaris 9 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:111574 Archived-At: In article <9d644d9b0906171919x3b05cc2eu6af3db8d113ee6cd@mail.gmail.com>, Jihyun Cho writes: > I ran the following test. > First, I applied a old patch. > I saved a file with VIM with the option "set fenc=cp949". > Then I loaded the file with EMACS. It is broken in my UTF-8 environment. > So I was typing "M-x revert-buffer-with-coding-system", "cp949", then > it looks well. > After applying this patch, I ran a same test. > It shows a wrong letter. > I guess the problem is related to coding system. > The problem that "HANGUL SYLLABLE HAEH" is shown "HANGUL SYLLABLE > JWIG" occured in EUC-KR coding system. > Because "HANGUL SYLLABLE HAEH" is not contained in EUC-KR region. > But CP949 contains "HANGUL SYLLABLE HAEH". > This patch could not fix it. Wiebe's patch doesn't contain the change of cp949 "coding-system". So, what you did is the same as reading a cp949 file by euc-kr coding-system. By the way, decoding "\xc1\x64" as U+C951 is a bug of decoding routine for EUC-type coding systems. It should treat that sequence as invalid as Emacs 22 does. I've just installed a fix. With the following additional patch, you should be able to read a cp949 file by cp949 coding-system correctly. Index: korean.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/language/korean.el,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- korean.el 5 Jan 2009 03:22:27 -0000 1.41 +++ korean.el 18 Jun 2009 01:15:32 -0000 1.42 @@ -43,7 +43,6 @@ (define-coding-system-alias 'euc-kr 'korean-iso-8bit) (define-coding-system-alias 'euc-korea 'korean-iso-8bit) -(define-coding-system-alias 'cp949 'korean-iso-8bit) (define-coding-system 'iso-2022-kr "ISO 2022 based 7-bit encoding for Korean KSC5601 (MIME:ISO-2022-KR)." @@ -58,6 +57,14 @@ (define-coding-system-alias 'korean-iso-7bit-lock 'iso-2022-kr) +(define-coding-system 'korean-cp949 + "CP949 (Microsoft Unified Hangul Code)" + :coding-type 'charset + :mnemonic ?K + :charset-list '(ascii cp949)) + +(define-coding-system-alias 'cp949 'korean-cp949) + (set-language-info-alist "Korean" '((setup-function . setup-korean-environment-internal) (exit-function . exit-korean-environment) Yidong and Stefan, I have not yet installed this change because it is a fix for the bug existing in Emacs 22. But, the change itself is very safe and the effect is that Emacs can correctly decode all CP949 files some of which were not decodable previously. In addition, it seems that CP949 is very important for Korean Windows users. Shall I install it now? --- Kenichi Handa handa@m17n.org