]> git.eshelyaron.com Git - emacs.git/commitdiff
(x-set-cut-buffer): Encode STRING if necessary.
authorKenichi Handa <handa@m17n.org>
Mon, 25 Oct 2004 00:22:02 +0000 (00:22 +0000)
committerKenichi Handa <handa@m17n.org>
Mon, 25 Oct 2004 00:22:02 +0000 (00:22 +0000)
lisp/ChangeLog
lisp/select.el

index e99856fe5f3ef769e63d76826198853537e5f436..25e0f80134e4695c4984b70e31ad8d92b980c322 100644 (file)
@@ -1,3 +1,7 @@
+2004-10-25  Kenichi Handa  <handa@m17n.org>
+
+       * select.el (x-set-cut-buffer): Encode STRING if necessary.
+
 2004-10-24  Luc Teirlinck  <teirllm@auburn.edu>
 
        * indent.el (set-left-margin, set-right-margin): Delete redundant
index 565ddd7d22ecf221ae718729bdf7db288824a26f..bca19a5cd6e097cf9d7529ec60b2cd29008298fa 100644 (file)
@@ -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))
 
 \f