unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
Cc: romain@orebokech.com, emacs-devel@gnu.org
Subject: Re: Cut buffers and character encoding
Date: Fri, 10 Nov 2006 19:24:25 +0900	[thread overview]
Message-ID: <E1GiTYf-00072J-00@etlken> (raw)
In-Reply-To: <45542D63.5070402@swipnet.se> (jan.h.d@swipnet.se)

In article <45542D63.5070402@swipnet.se>, "Jan D." <jan.h.d@swipnet.se> writes:

> Romain Francoise skrev:
> > "Jan D." <jan.h.d@swipnet.se> writes:
> > 
>>> The text encoding for cut buffers are defined to be ISO-Latin-1, so
>>> selection-coding-system should not have any effect.  That said, we
>>> could decode data from cut buffers from Latin-1 and encode to Latin-1
>>> when putting data in there.
> > 
> > Ah, thanks, you put me on the right track.
> > 
> > Emacs *does* decode the contents of the cut buffer in the
> > `x-cut-buffer-or-selection-value' function, but it tries to decode them
> > using `locale-coding-system' which is wrong if the locale is a UTF-8
> > locale...
> > 
> > The following patch fixes the problem for me, and if cut buffers are
> > *always* iso-latin-1 then it should be the right thing.  WDYT?

> I've committed this change and the corresponding when writing to a cut buffer.
> I also changed the documentation you pointed out was wrong.

I vaguely remember that I changed cut-buffer decoding to use
locale-coding-system (if any) instead of iso-8859-1 upon a
bug report from someone.  He claimed that many X
applications store a data encoded by the current locale in
cut-buffer (even if that doesn't conform to ICCCM), thus it
is better that Emacs also decodes it by the coding system
specified by the locale.  Even xterm, when run under, for
instance, cs_CS.ISO8859-2 locale, stores ISO8859-2
characters as is in cut buffer.

In the case of the origianl bug report, "éèê" is actually
tried to be decoded by utf-8 and failed.

Anyway, the documentation bug of selection-coding-system
should be fixed.  But, it may be good to use
next-selection-coding-system even for cut buffer if it is
set temporarily by C-x RET X.

---
Kenichi Handa
handa@m17n.org

  reply	other threads:[~2006-11-10 10:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-09  7:39 Cut buffers and character encoding Romain Francoise
2006-11-09 19:10 ` Jan D.
2006-11-09 20:56   ` Romain Francoise
2006-11-10  7:42     ` Jan D.
2006-11-10 10:24       ` Kenichi Handa [this message]
2006-11-10 13:39         ` Romain Francoise
2006-11-11 12:40           ` Kenichi Handa
2006-11-12  5:14             ` Richard Stallman
2006-11-18  2:23               ` Kenichi Handa
2006-11-18 13:18                 ` Jan Djärv
2006-11-20  3:23                   ` Katsumi Yamaoka
2006-11-20  7:44                     ` Jan Djärv
2006-11-20  7:57                       ` Katsumi Yamaoka
2006-11-20 23:58                       ` Richard Stallman
2006-11-21 12:47                         ` Jan Djärv
2006-11-18 16:05                 ` Richard Stallman
2006-11-10 18:41   ` Richard Stallman

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=E1GiTYf-00072J-00@etlken \
    --to=handa@m17n.org \
    --cc=emacs-devel@gnu.org \
    --cc=romain@orebokech.com \
    /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).