From: Kenichi Handa Date: Mon, 25 Oct 2004 00:22:02 +0000 (+0000) Subject: (x-set-cut-buffer): Encode STRING if necessary. X-Git-Tag: ttn-vms-21-2-B4~4415 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c0f7266a85de8df528e0f5ceba0702b8f979c176;p=emacs.git (x-set-cut-buffer): Encode STRING if necessary. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e99856fe5f3..25e0f80134e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2004-10-25 Kenichi Handa + + * select.el (x-set-cut-buffer): Encode STRING if necessary. + 2004-10-24 Luc Teirlinck * indent.el (set-left-margin, set-right-margin): Delete redundant diff --git a/lisp/select.el b/lisp/select.el index 565ddd7d22e..bca19a5cd6e 100644 --- a/lisp/select.el +++ b/lisp/select.el @@ -144,6 +144,11 @@ Cut buffers are considered obsolete; you should use selections instead." (or (stringp string) (signal 'wrong-type-argument (list 'string string))) (if push (x-rotate-cut-buffers-internal 1)) + (if (> (string-bytes string) (length string)) + ;; STRING is a multibyte string contains non-ASCII characters. + (if locale-coding-system + (setq string (encode-coding-string string locale-coding-system)) + (setq string (string-make-unibyte string)))) (x-store-cut-buffer-internal 'CUT_BUFFER0 string))