summaryrefslogtreecommitdiff
path: root/lisp/x-dnd.el
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2004-04-03 20:24:17 +0000
committerKaroly Lorentey <lorentey@elte.hu>2004-04-03 20:24:17 +0000
commit1ba538094c4cd3da172d91878fa76d96c6b1cbd2 (patch)
treed9379406f3598de5db893fd0f01d6ae214a711d1 /lisp/x-dnd.el
parentb04f5ad2cc0f71e567ec9ee49351f45f0a5faa3a (diff)
parent9f691b0dd903205d12e447c753bcd92741c68707 (diff)
downloademacs-1ba538094c4cd3da172d91878fa76d96c6b1cbd2.tar.gz
Merged in changes from CVS HEAD
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-177 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-178 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-179 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-180 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-131
Diffstat (limited to 'lisp/x-dnd.el')
-rw-r--r--lisp/x-dnd.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el
index 32645bd6012..41e9e3e78b2 100644
--- a/lisp/x-dnd.el
+++ b/lisp/x-dnd.el
@@ -337,7 +337,12 @@ WINDOW is the window where the drop happened. ACTION is ignored.
DATA is the moz-url, which is formatted as two strings separated by \r\n.
The first string is the URL, the second string is the title of that URL.
DATA is encoded in utf-16. Decode the URL and call `x-dnd-handle-uri-list'."
- (let* ((string (decode-coding-string data 'utf-16le)) ;; ALWAYS LE???
+ ;; Mozilla and applications based on it (Galeon for example) uses
+ ;; text/unicode, but it is impossible to tell if it is le or be. Use what
+ ;; the machine Emacs runs on use. This looses if dropping between machines
+ ;; with different endian, but it is the best we can do.
+ (let* ((coding (if (eq (byteorder) ?B) 'utf-16be 'utf-16le))
+ (string (decode-coding-string data coding))
(strings (split-string string "[\r\n]" t))
;; Can one drop more than one moz-url ?? Assume not.
(url (car strings))
@@ -352,7 +357,9 @@ TEXT is the text as a string, WINDOW is the window where the drop happened."
(defun x-dnd-insert-utf16-text (window action text)
"Decode the UTF-16 text and insert it at point.
TEXT is the text as a string, WINDOW is the window where the drop happened."
- (x-dnd-insert-text window action (decode-coding-string text 'utf-16le)))
+ ;; See comment in x-dnd-handle-moz-url about coding.
+ (let ((coding (if (eq (byteorder) ?B) 'utf-16be 'utf-16le)))
+ (x-dnd-insert-text window action (decode-coding-string text coding))))
(defun x-dnd-insert-ctext (window action text)
"Decode the compound text and insert it at point.