summaryrefslogtreecommitdiff
path: root/lisp/select.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/select.el')
-rw-r--r--lisp/select.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/select.el b/lisp/select.el
index 01d1af6edf1..cbdeaf12fe3 100644
--- a/lisp/select.el
+++ b/lisp/select.el
@@ -223,8 +223,11 @@ Cut buffers are considered obsolete; you should use selections instead."
(setq str (encode-coding-string str coding))))
((eq type 'UTF8_STRING)
- (setq str (encode-coding-string str 'utf-8)))
-
+ (let ((charsets (find-charset-string str)))
+ (if (or (memq 'eight-bit-control charsets)
+ (memq 'eight-bit-graphic charsets))
+ (setq type 'STRING)
+ (setq str (encode-coding-string str 'utf-8)))))
(t
(error "Unknow selection type: %S" type))
)))