all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
To: Jihyun Cho <jihyun.jo@gmail.com>
Cc: usenet@pusto.de, emacs-devel@gnu.org
Subject: Re: cp949 support
Date: Thu, 18 Jun 2009 20:14:44 +0900	[thread overview]
Message-ID: <E1MHFZs-0000P0-Vp@etlken> (raw)
In-Reply-To: <9d644d9b0906171919x3b05cc2eu6af3db8d113ee6cd@mail.gmail.com> (message from Jihyun Cho on Thu, 18 Jun 2009 11:19:05 +0900)

In article <9d644d9b0906171919x3b05cc2eu6af3db8d113ee6cd@mail.gmail.com>, Jihyun Cho <jihyun.jo@gmail.com> 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




  reply	other threads:[~2009-06-18 11:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-15 21:11 cp949 support Eduard Wiebe
2009-06-16  0:58 ` Kenichi Handa
2009-06-17  8:07   ` Jihyun Cho
2009-06-17 11:20     ` Kenichi Handa
2009-06-17 20:54       ` Eduard Wiebe
2009-06-18  2:19         ` Jihyun Cho
2009-06-18 11:14           ` Kenichi Handa [this message]
2009-06-18 13:05             ` Chong Yidong
2009-06-18 21:33               ` User Ew
2009-06-19  0:40             ` Kenichi Handa
2009-06-20  8:42               ` Eduard Wiebe
2009-06-22  1:37                 ` Kenichi Handa
2009-07-01 12:39                 ` Kenichi Handa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1MHFZs-0000P0-Vp@etlken \
    --to=handa@m17n.org \
    --cc=emacs-devel@gnu.org \
    --cc=jihyun.jo@gmail.com \
    --cc=usenet@pusto.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.