diff options
author | Kenichi Handa <handa@m17n.org> | 2004-10-25 00:22:02 +0000 |
---|---|---|
committer | Kenichi Handa <handa@m17n.org> | 2004-10-25 00:22:02 +0000 |
commit | c0f7266a85de8df528e0f5ceba0702b8f979c176 (patch) | |
tree | 5af3315dc4a603bbde94b2232e13ca6ce3dbad24 /lisp/select.el | |
parent | 29dc7809d5c02249669417a982a3d1d14eb15f73 (diff) | |
download | emacs-c0f7266a85de8df528e0f5ceba0702b8f979c176.tar.gz |
(x-set-cut-buffer): Encode STRING if necessary.
Diffstat (limited to 'lisp/select.el')
-rw-r--r-- | lisp/select.el | 5 |
1 files changed, 5 insertions, 0 deletions
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)) |