all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#5387: MS950 alias for CP950 charset
@ 2010-01-15 11:01 jidanni
  2010-01-15 11:46 ` Kenichi Handa
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: jidanni @ 2010-01-15 11:01 UTC (permalink / raw)
  To: bug-gnu-emacs; +Cc: handa

I signed up on the Legislature of Taiwan's website, and the confirmation
mail had
From: sysop@ly.gov.tw
Subject: =?BIG5?B?pd+qa7B8pf6yebjqsFS69C2/76XBqkGwyLHSsMq9VLt7qOc=?=
Mime-Version: 1.0
Content-Type: text/html; charset=MS950
Content-Transfer-Encoding: quoted-printable

And it turns out MS950 is an alias for CP950, so perhaps emacs should
incorporate this alias, even though this is the first time I've seen it.
Perhaps make all MSxxx be aliases for CPxxx.







^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#5387: MS950 alias for CP950 charset
  2010-01-15 11:01 bug#5387: MS950 alias for CP950 charset jidanni
@ 2010-01-15 11:46 ` Kenichi Handa
  2010-01-15 11:55 ` jidanni
  2010-01-16  1:15 ` jidanni
  2 siblings, 0 replies; 7+ messages in thread
From: Kenichi Handa @ 2010-01-15 11:46 UTC (permalink / raw)
  To: jidanni; +Cc: 5387

In article <87aawfzl6w.fsf@jidanni.org>, jidanni@jidanni.org writes:

> I signed up on the Legislature of Taiwan's website, and the confirmation
> mail had
> From: sysop@ly.gov.tw
> Subject: =?BIG5?B?pd+qa7B8pf6yebjqsFS69C2/76XBqkGwyLHSsMq9VLt7qOc=?=
> Mime-Version: 1.0
> Content-Type: text/html; charset=MS950
> Content-Transfer-Encoding: quoted-printable

> And it turns out MS950 is an alias for CP950,

Where did you get that information?

> so perhaps emacs should
> incorporate this alias, even though this is the first time I've seen it.
> Perhaps make all MSxxx be aliases for CPxxx.

I checked <http://www.iana.org/assignments/character-sets>
and found that only MS936 is listed as an alias of GBK.

---
Kenichi Handa
handa@m17n.org






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#5387: MS950 alias for CP950 charset
  2010-01-15 11:01 bug#5387: MS950 alias for CP950 charset jidanni
  2010-01-15 11:46 ` Kenichi Handa
@ 2010-01-15 11:55 ` jidanni
  2010-01-15 12:57   ` Kenichi Handa
  2010-01-16  1:15 ` jidanni
  2 siblings, 1 reply; 7+ messages in thread
From: jidanni @ 2010-01-15 11:55 UTC (permalink / raw)
  To: handa; +Cc: 5387

>> And it turns out MS950 is an alias for CP950,
K> Where did you get that information?
I inferred it from my single encounter.
K> I checked <http://www.iana.org/assignments/character-sets>
K> and found that only MS936 is listed as an alias of GBK.
That makes two... or 1.5.






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#5387: MS950 alias for CP950 charset
  2010-01-15 11:55 ` jidanni
@ 2010-01-15 12:57   ` Kenichi Handa
       [not found]     ` <873a26j1e3.fsf@jidanni.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Kenichi Handa @ 2010-01-15 12:57 UTC (permalink / raw)
  To: jidanni; +Cc: 5387

In article <87my0fy44r.fsf@jidanni.org>, jidanni@jidanni.org writes:

>>> And it turns out MS950 is an alias for CP950,
>>> Where did you get that information?
> I inferred it from my single encounter.
>>> I checked <http://www.iana.org/assignments/character-sets>
>>> and found that only MS936 is listed as an alias of GBK.
> That makes two... or 1.5.

And,
iconv: MS932, MS936, MSCP949, MSCP1361
python: ms932, ms936, ms949, ms950, ms1361

hmmm...

I've just installed the attached change to accept msXXX.
canonicalize-coding-system-name is used by
coding-system-from-name, and, at least, rmail uses it.

If you are using rmail, please try the latest code, or the
attached patch.

---
Kenichi Handa
handa@m17n.org

=== modified file 'lisp/international/mule-cmds.el'
--- lisp/international/mule-cmds.el	2010-01-13 08:35:10 +0000
+++ lisp/international/mule-cmds.el	2010-01-15 12:33:24 +0000
@@ -226,19 +226,22 @@
 ;; and delimiter characters.  Support function of
 ;; coding-system-from-name.
 (defun canonicalize-coding-system-name (name)
-  (if (string-match "^iso[-_ ]?[0-9]" name)
-      ;; "iso-8859-1" -> "8859-1", "iso-2022-jp" ->"2022-jp"
-      (setq name (substring name (1- (match-end 0)))))
-  (let ((idx (string-match "[-_ /]" name)))
-    ;; Delete "-", "_", " ", "/" but do distinguish "16-be" and "16be".
-    (while idx
-      (if (and (>= idx 2)
-	       (eq (string-match "16-[lb]e$" name (- idx 2))
-		   (- idx 2)))
-	  (setq idx (string-match "[-_ /]" name (match-end 0)))
-	(setq name (concat (substring name 0 idx) (substring name (1+ idx)))
-	      idx (string-match "[-_ /]" name idx))))
-    name))
+  (if (string-match "^\\(ms\\|ibm\\|windows-\\)\\([0-9]+\\)$" name)
+      ;; "ms950", "ibm950", "windows-950" -> "cp950"
+      (concat "cp" (match-string 2 name))
+    (if (string-match "^iso[-_ ]?[0-9]" name)
+	;; "iso-8859-1" -> "8859-1", "iso-2022-jp" ->"2022-jp"
+	(setq name (substring name (1- (match-end 0)))))
+    (let ((idx (string-match "[-_ /]" name)))
+      ;; Delete "-", "_", " ", "/" but do distinguish "16-be" and "16be".
+      (while idx
+	(if (and (>= idx 2)
+		 (eq (string-match "16-[lb]e$" name (- idx 2))
+		     (- idx 2)))
+	    (setq idx (string-match "[-_ /]" name (match-end 0)))
+	  (setq name (concat (substring name 0 idx) (substring name (1+ idx)))
+		idx (string-match "[-_ /]" name idx))))
+      name)))
 
 (defun coding-system-from-name (name)
   "Return a coding system whose name matches with NAME (string or symbol)."







^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#5387: MS950 alias for CP950 charset
  2010-01-15 11:01 bug#5387: MS950 alias for CP950 charset jidanni
  2010-01-15 11:46 ` Kenichi Handa
  2010-01-15 11:55 ` jidanni
@ 2010-01-16  1:15 ` jidanni
  2 siblings, 0 replies; 7+ messages in thread
From: jidanni @ 2010-01-16  1:15 UTC (permalink / raw)
  To: handa; +Cc: 5387, ding

>>>>> "K" == Kenichi Handa <handa@m17n.org> writes:
K> I've just installed the attached change to accept msXXX.
K> canonicalize-coding-system-name is used by
K> coding-system-from-name, and, at least, rmail uses it.
I'll CC the gnus people to make sure they will use it too.






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#5387: MS950 alias for CP950 charset
       [not found]     ` <873a26j1e3.fsf@jidanni.org>
@ 2010-01-16 12:09       ` Reiner Steib
       [not found]       ` <871vhqw8ss.fsf@marauder.physik.uni-ulm.de>
  1 sibling, 0 replies; 7+ messages in thread
From: Reiner Steib @ 2010-01-16 12:09 UTC (permalink / raw)
  To: jidanni, handa; +Cc: 5387, ding

On Sat, Jan 16 2010, jidanni@jidanni.org wrote:

>>>>>> "K" == Kenichi Handa <handa@m17n.org> writes:
> K> I've just installed the attached change to accept msXXX.

Please add "(Bug#5387)" to the ChangeLog entry.

> K> canonicalize-coding-system-name is used by
> K> coding-system-from-name, and, at least, rmail uses it.
> I'll CC the gnus people to make sure they will use it too.

Gnus should use all coding-systems / charsets provided by Emacs.  No
change in Gnus required.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#5387: MS950 alias for CP950 charset
       [not found]       ` <871vhqw8ss.fsf@marauder.physik.uni-ulm.de>
@ 2010-01-18  1:14         ` Kenichi Handa
  0 siblings, 0 replies; 7+ messages in thread
From: Kenichi Handa @ 2010-01-18  1:14 UTC (permalink / raw)
  To: Reiner Steib; +Cc: 5387, ding, jidanni

In article <871vhqw8ss.fsf@marauder.physik.uni-ulm.de>, Reiner Steib <reinersteib+gmane@imap.cc> writes:

> On Sat, Jan 16 2010, jidanni@jidanni.org wrote:
>>>>>>> "K" == Kenichi Handa <handa@m17n.org> writes:
> > K> I've just installed the attached change to accept msXXX.

> Please add "(Bug#5387)" to the ChangeLog entry.

Ah, ok, just done.

> > K> canonicalize-coding-system-name is used by
> > K> coding-system-from-name, and, at least, rmail uses it.
> > I'll CC the gnus people to make sure they will use it too.

> Gnus should use all coding-systems / charsets provided by Emacs.  No
> change in Gnus required.

But MS950 is still not a coding-system in Emacs.
coding-system-from-name is a function to guess a coding
system from the given name.

(coding-system-from-name "MS950")
cp950
(coding-system-p 'MS950)
nil
(coding-system-p 'CP950)
nil
(coding-system-from-name "CP950")
cp950
(coding-system-p 'cp950)
t

---
Kenichi Handa
handa@m17n.org






^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-01-18  1:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-15 11:01 bug#5387: MS950 alias for CP950 charset jidanni
2010-01-15 11:46 ` Kenichi Handa
2010-01-15 11:55 ` jidanni
2010-01-15 12:57   ` Kenichi Handa
     [not found]     ` <873a26j1e3.fsf@jidanni.org>
2010-01-16 12:09       ` Reiner Steib
     [not found]       ` <871vhqw8ss.fsf@marauder.physik.uni-ulm.de>
2010-01-18  1:14         ` Kenichi Handa
2010-01-16  1:15 ` jidanni

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.