6
votes

Using Emacs on my linux box (wheezy, awesome,gnome and kde) I run into big trouble using clipboard even from one emacs instance to another.

Everything I put into the clipboard is converted into chinese looking characters in emacs. Only solution is to copy paste into some other editor (e.g. nano, vi) save it and open it in emacs.

I use the same .emacs on my other (ubuntu) computer and on windows 7 with out any trouble. I erased all my previous encoding settings I had without any success.

http://stackoverflow.com/questions/ask

after copy paste gets

栊瑴㩰⼯瑳捡潫敶晲潬⹷潣⽭畱獥楴湯⽳獡k
3
It is a debian package (23.4)and the same problem existet with the preious install (23.3). - louis cypher
I actually cannot afford breaking anything, so I think it isn't a good idea to try reinstalling (the setup works exelent besides that problem). I hope to find someone who knows/shares the problem. - louis cypher
I installed emacs 24 ("clean install"). I still get some funny chinese characters. - louis cypher
How do you "copy" the text into the clipboard? And paste? - Kan-Ru Chen

3 Answers

2
votes

I run into the same problem today, with a little different environment tho. I've been using Emacs 24.3.1 on Windows 7, then switched to the same version running under Cygwin+XWin with the same .emacs.d config. While clipboard under Windows worked fine, with the config I had under Cygwin/XWin I had the same problem as in the question.

Under terminal it worked fine, with XWin the -Q worked too, so after a little digging, it turned out to be:

;; MS Windows clipboard is UTF-16LE
(set-clipboard-coding-system 'utf-16le-dos)

I don't remember why I added this. I must have copied it from some Emacs Wiki in early days. When I googled it now, it seems like a popular setting in people configs. It turns out, under Windows I don't need this line for clipboard to work properly with Emacs (quick check with some polish diacritical characters), and under Cygwin/XWin it finally started to work.

1
votes

(sorry, I haven't the reputation to comment, so I leave a clarification request here)

  • Are you using emacs in a terminal ? if so, which one (konsole, lxterm, xterm...) ?

  • Are you cut'n'pasting with mouse (middle click) or keyboard ?

  • Have you any clipboard manager running (eg glipper) ?

0
votes

Do you get the same behavior if you start without an init file (~/.emacs), that is, using emacs -Q?

If you can come up with a reproducible recipe starting from emacs -Q then, unless you get some solution proposed here, consider filing an Emacs bug report: M-x report-emacs-bug.