]> git.eshelyaron.com Git - emacs.git/commitdiff
* select.el (xselect-convert-to-string): If UTF8_STRING is requested
authorJan Djärv <jan.h.d@swipnet.se>
Sat, 16 Sep 2006 17:12:38 +0000 (17:12 +0000)
committerJan Djärv <jan.h.d@swipnet.se>
Sat, 16 Sep 2006 17:12:38 +0000 (17:12 +0000)
 and the data doesn't look like UTF8, send STRING instead.

lisp/ChangeLog
lisp/select.el

index e349a82bab39a31ba45cc529ee3e5bd0f204fa64..bd291081b9d2066f0673fafb3b0015902a6753fd 100644 (file)
@@ -1,3 +1,8 @@
+2006-09-16  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * select.el (xselect-convert-to-string): If UTF8_STRING is requested
+       and the data doesn't look like UTF8, send STRING instead.
+
 2006-09-16  Agustin Martin <agustin.martin@hispalinux.es>
 
        * textmodes/flyspell.el (flyspell-check-region-doublons): New
index 01d1af6edf10b61b02670d4c0b86d8db21000fc4..cbdeaf12fe304af17e0fff5101f14cad8676ed2a 100644 (file)
@@ -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))
           )))