summaryrefslogtreecommitdiff
path: root/lisp/select.el
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2006-09-16 17:12:38 +0000
committerJan Djärv <jan.h.d@swipnet.se>2006-09-16 17:12:38 +0000
commitb984fed926ff00c7468acc0f6f4b0fc1ad6c72be (patch)
treef57260feb43a41e95a2dbf796547dbd419ddad67 /lisp/select.el
parent6875fe9ae6a55d6323839fd09b3624afeab77524 (diff)
downloademacs-b984fed926ff00c7468acc0f6f4b0fc1ad6c72be.tar.gz
* select.el (xselect-convert-to-string): If UTF8_STRING is requested
and the data doesn't look like UTF8, send STRING instead.
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))
)))