From: Jan Djärv Date: Sat, 16 Sep 2006 17:12:38 +0000 (+0000) Subject: * select.el (xselect-convert-to-string): If UTF8_STRING is requested X-Git-Tag: emacs-pretest-22.0.90~517 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b984fed926ff00c7468acc0f6f4b0fc1ad6c72be;p=emacs.git * select.el (xselect-convert-to-string): If UTF8_STRING is requested and the data doesn't look like UTF8, send STRING instead. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e349a82bab3..bd291081b9d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-09-16 Jan Dj,Ad(Brv + + * 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 * textmodes/flyspell.el (flyspell-check-region-doublons): New 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)) )))