changeset 57681:f1caf7fce72c

(x-set-cut-buffer): Encode STRING if necessary.
author Kenichi Handa <handa@m17n.org>
date Mon, 25 Oct 2004 00:20:57 +0000
parents a375ae66b2ef
children 7004ed510410
files lisp/select.el
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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))