[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Cut buffers and character encoding
From: |
Romain Francoise |
Subject: |
Re: Cut buffers and character encoding |
Date: |
Thu, 09 Nov 2006 21:56:29 +0100 |
"Jan D." <address@hidden> 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?
Index: lisp/term/x-win.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/x-win.el,v
retrieving revision 1.194
diff -c -r1.194 x-win.el
*** lisp/term/x-win.el 18 Oct 2006 14:05:02 -0000 1.194
--- lisp/term/x-win.el 9 Nov 2006 20:54:47 -0000
***************
*** 2346,2353 ****
(t
(setq x-last-selected-text-cut-encoded cut-text
x-last-selected-text-cut
! (decode-coding-string cut-text (or locale-coding-system
! 'iso-latin-1))))))
;; As we have done one selection, clear this now.
(setq next-selection-coding-system nil)
--- 2346,2352 ----
(t
(setq x-last-selected-text-cut-encoded cut-text
x-last-selected-text-cut
! (decode-coding-string cut-text 'iso-latin-1)))))
;; As we have done one selection, clear this now.
(setq next-selection-coding-system nil)
--
Romain Francoise <address@hidden> | The sea! the sea! the open
it's a miracle -- http://orebokech.com/ | sea! The blue, the fresh, the
| ever free! --Bryan W. Procter
- Cut buffers and character encoding, Romain Francoise, 2006/11/09
- Re: Cut buffers and character encoding, Jan D., 2006/11/09
- Re: Cut buffers and character encoding,
Romain Francoise <=
- Re: Cut buffers and character encoding, Jan D., 2006/11/10
- Re: Cut buffers and character encoding, Kenichi Handa, 2006/11/10
- Re: Cut buffers and character encoding, Romain Francoise, 2006/11/10
- Re: Cut buffers and character encoding, Kenichi Handa, 2006/11/11
- Re: Cut buffers and character encoding, Richard Stallman, 2006/11/12
- Re: Cut buffers and character encoding, Kenichi Handa, 2006/11/17
- Re: Cut buffers and character encoding, Jan Djärv, 2006/11/18
- Re: Cut buffers and character encoding, Katsumi Yamaoka, 2006/11/19
- Re: Cut buffers and character encoding, Jan Djärv, 2006/11/20
- Re: Cut buffers and character encoding, Katsumi Yamaoka, 2006/11/20