Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: ding@gnus.org
Subject: Re: Double encoding in ~/Mail/active
Date: Wed, 04 Aug 2010 09:38:02 +0900	[thread overview]
Message-ID: <b4mtynbus9h.fsf@jpl.org> (raw)
In-Reply-To: <87zkx42qc9.fsf@topper.koldfront.dk>

Adam Sjøgren wrote:
> On Tue, 03 Aug 2010 08:21:17 +0900, Katsumi wrote:
[...]
>>> Is this a GNU Emacs or an XEmacs bug? I guess it should be reported?
>> No, it's my fault. ;-p

> But isn't it inconsistent "in a bad way" that GNU Emacs won't double
> encode a string and XEmacs will? Wouldn't it be better if both emacsen
> behaved the same?

> I.e. your example:

>  (decode-coding-string
>   (encode-coding-string
>    (encode-coding-string "hyskenstræde" 'utf-8)
>    'utf-8)
>   'utf-8)

> ought to give either "hyskenstræde" or "hyskenstræde" on both emacsen?

First of all, I believe what is bad is a source code that does
the double encoding (I made ;-).

I don't know exactly how Emacs decides whether to encode an encoded
string but I guess the point is the multibyteness or other.  In
Emacs, an encoded string is always a unibyte string, that is not
worth encoding.  Though the double encoding happens in Emacs 21
and 22, and the following form returns the one that is the same
as that of XEmacs:

(decode-coding-string
 (encode-coding-string
  (string-make-multibyte
   (encode-coding-string "hyskenstræde" 'utf-8))
  'utf-8)
 'utf-8)

But as for Emacs 23 and greater (i.e. Unicode Emacsen), the double
encoding doesn't happen even for that form.  Those Emacsen may
examine what the data are.

OTOH, there is no concept of the multibyteness in XEmacs.  Making
XEmacs behave like the recent Emacsen may possibly mean making it
follow a long journey that Emacs trudged along.  And I think it
goes for nothing.  Again, the bad was me. ;-)



      reply	other threads:[~2010-08-04  0:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-31 14:03 Stack overflow: Stack overflow in regexp matcher Adam Sjøgren
2010-07-31 22:02 ` Adam Sjøgren
2010-08-01  5:25 ` Adam Sjøgren
2010-08-01  7:55   ` Double encoding in ~/Mail/active Adam Sjøgren
2010-08-01 10:58     ` Katsumi Yamaoka
2010-08-01 11:13       ` Adam Sjøgren
2010-08-02  0:14         ` Katsumi Yamaoka
2010-08-02 21:43           ` Adam Sjøgren
2010-08-02 23:21             ` Katsumi Yamaoka
2010-08-03  5:54               ` Adam Sjøgren
2010-08-04  0:38                 ` Katsumi Yamaoka [this message]

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=b4mtynbus9h.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=ding@gnus.org \
    /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.
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 NNTP newsgroup(s).