# HG changeset patch # User Kenichi Handa # Date 1098663657 0 # Node ID f1caf7fce72c4a08ba716eaa7832adace88bcd28 # Parent a375ae66b2ef214df8774e12264ffe9cc8d988df (x-set-cut-buffer): Encode STRING if necessary. diff -r a375ae66b2ef -r f1caf7fce72c lisp/select.el --- a/lisp/select.el Sun Oct 24 21:45:18 2004 +0000 +++ b/lisp/select.el Mon Oct 25 00:20:57 2004 +0000 @@ -144,6 +144,11 @@ (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))