emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cut buffers and character encoding


From: Jan D.
Subject: Re: Cut buffers and character encoding
Date: Fri, 10 Nov 2006 08:42:27 +0100
User-agent: Thunderbird 1.5.0.7 (X11/20060918)

Romain Francoise skrev:
> "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?

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


        Jan D.

> 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)
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]