Commit f16e5386 authored by Chong Yidong's avatar Chong Yidong
Browse files

* select.el (xselect--encode-string): Always use utf-8 for TEXT on Nextstep.

parent 8d8d67ae
2012-05-04 Chong Yidong <cyd@gnu.org>
* select.el (xselect--encode-string): Always use utf-8 for TEXT on
Nextstep.
2012-04-30 Eli Zaretskii <eliz@gnu.org> 2012-04-30 Eli Zaretskii <eliz@gnu.org>
* mail/rmail.el (rmail-yank-current-message): Use the encoding of * mail/rmail.el (rmail-yank-current-message): Use the encoding of
......
...@@ -228,24 +228,30 @@ two markers or an overlay. Otherwise, it is nil." ...@@ -228,24 +228,30 @@ two markers or an overlay. Otherwise, it is nil."
;; But avoid modifying the string if it's a buffer name etc. ;; But avoid modifying the string if it's a buffer name etc.
(unless can-modify (setq str (substring str 0))) (unless can-modify (setq str (substring str 0)))
(remove-text-properties 0 (length str) '(composition nil) str) (remove-text-properties 0 (length str) '(composition nil) str)
;; TEXT is a polymorphic target. Select the actual type ;; For X selections, TEXT is a polymorphic target; choose
;; from `UTF8_STRING', `COMPOUND_TEXT', `STRING', and ;; the actual type from `UTF8_STRING', `COMPOUND_TEXT',
;; `C_STRING'. ;; `STRING', and `C_STRING'. On Nextstep, always use UTF-8
(if (eq type 'TEXT) ;; (see ns_string_to_pasteboard_internal in nsselect.m).
(if (not (multibyte-string-p str)) (when (eq type 'TEXT)
(setq type 'C_STRING) (cond
(let (non-latin-1 non-unicode eight-bit) ((featurep 'ns)
(mapc #'(lambda (x) (setq type 'UTF8_STRING))
(if (>= x #x100) ((not (multibyte-string-p str))
(if (< x #x110000) (setq type 'C_STRING))
(setq non-latin-1 t) (t
(if (< x #x3FFF80) (let (non-latin-1 non-unicode eight-bit)
(setq non-unicode t) (mapc #'(lambda (x)
(setq eight-bit t))))) (if (>= x #x100)
str) (if (< x #x110000)
(setq type (if non-unicode 'COMPOUND_TEXT (setq non-latin-1 t)
(if non-latin-1 'UTF8_STRING (if (< x #x3FFF80)
(if eight-bit 'C_STRING 'STRING))))))) (setq non-unicode t)
(setq eight-bit t)))))
str)
(setq type (if non-unicode 'COMPOUND_TEXT
(if non-latin-1 'UTF8_STRING
(if eight-bit 'C_STRING
'STRING))))))))
(cond (cond
((eq type 'UTF8_STRING) ((eq type 'UTF8_STRING)
(if (or (not coding) (if (or (not coding)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment