unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Reiner Steib <4.uce.03.r.s@nurfuerspam.de>
Cc: Kenichi Handa <handa@m17n.org>
Subject: Re: Broken charset=utf-16be articles with Gnus and Emacs 21.3
Date: Mon, 31 Mar 2003 15:41:28 +0200	[thread overview]
Message-ID: <v9u1dj64c7.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: m3znncrv84.fsf@defun.localdomain

On Mon, Mar 31 2003, Jesper Harder wrote:

> FWIW, Oort Gnus and current CVS Emacs works as expected.  It used to
> exhibit the same bug you're describing, 

Yes, I remember seeing this on the Ding-List in some of Kai's
articles.  But Kai and me didn't recall whether the problem was in
Emacs CVS-HEAD or in Oort Gnus (and whether it was fixed or not).

> but I was fixed earlier this year -- probably by this change:
>
> 2003-01-03  Dave Love  <fx@gnu.org>
>
> 	* international/mule-cmds.el (sort-coding-systems):
> 	Adjust priority of utf-16 and x-ctext.

Yes, that's it, thanks for pointing this out.  After applying the
following patch to lisp/international/mule-cmds.el from Emacs 21.3.1
and evaluation `sort-coding-systems', I get utf-8 as expected.

--8<---------------cut here---------------start------------->8---
--- mule-cmds.el	26 Dec 2002 17:27:20 -0000	1.216
+++ mule-cmds.el	3 Jan 2003 20:16:11 -0000	1.217
@@ -425,9 +425,18 @@
 		    (let ((base (coding-system-base x)))
 		      (+ (if (eq base most-preferred) 64 0)
 			 (let ((mime (coding-system-get base 'mime-charset)))
+			   ;; Prefer coding systems corresponding to a
+			   ;; MIME charset.
 			   (if mime
-			       (if (string-match "^x-" (symbol-name mime))
-				   16 32)
+			       ;; Lower utf-16 priority so that we
+			       ;; normally prefer utf-8 to it, and put
+			       ;; x-ctext below that.
+			       (cond ((or (eq base 'mule-utf-16-le)
+					  (eq base 'mule-utf-16-be))
+				      16)
+				     ((string-match "^x-" (symbol-name mime))
+				      8)
+				     (t 32))
 			     0))
 			 (if (memq base lang-preferred) 8 0)
 			 (if (string-match "-with-esc$" (symbol-name base))
--8<---------------cut here---------------end--------------->8---

> Didn't it get applied to Emacs 21.3?

No.  If the EMACS_21_1_RC branch is still maintained, it should
probably be applied there as well.

On Mon, Mar 31 2003, Kenichi Handa wrote:

> Oops, I've just found that Emacs' coding systems utf-16-le and
> utf-16-be produce BOM (Byte Order Mark) which is a bug according to
> their specifications.  I've just installed a fix.

Does it make sense to apply it to EMACS_21_1_RC too?

>> Expected behavior:
>> - The article should be encoded with
>>   "Content-Type: text/plain; charset=utf-8".
> I don't know why GNUS prefers utf-16-X to utf-8.  At least,
> sort-coding-systems prefers utf-8.

Apparently not in Emacs 21.3, unless I misunderstood the
abovementioned patch to `sort-coding-systems'.

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

  reply	other threads:[~2003-03-31 13:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-29 11:11 Broken charset=utf-16be articles with Gnus and Emacs 21.3 Reiner Steib
2003-03-31  1:51 ` Kenichi Handa
2003-03-31  4:55 ` Jesper Harder
2003-03-31 13:41   ` Reiner Steib [this message]
2003-03-31 16:14     ` Mark Trettin

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=v9u1dj64c7.fsf@marauder.physik.uni-ulm.de \
    --to=4.uce.03.r.s@nurfuerspam.de \
    --cc=handa@m17n.org \
    --cc=reiner.steib@gmx.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).