Using clipboard / copy paste renders Chinese-style characters (debian sid)

Using Emacs in my linux box (wheezy, awesome, gnome and kde) I ran into big problems using the clipboard from even one emacs instance to another.

Everything that I put on the clipboard is converted to a Chinese character in emacs. The only solution is to copy the paste into some other editor (e.g. nano, vi), save it and open it in emacs.

I use the same .emacs on another computer (ubuntu) and on Windows 7 without any problems. I deleted all my previous encoding settings that I had without success.

http://stackoverflow.com/questions/ask 

after copying paste gets

 栊瑴㩰⼯瑳捡潫敶晲潬⹷潣⽭畱獥楴湯⽳獡k 
+6
source share
3 answers

Today I am facing the same problem, with a slightly different environment. I used Emacs 24.3.1 on Windows 7, and then switched to the same version as Cygwin + XWin with the same .emacs.d configuration. Although the clipboard on Windows worked fine, with the configuration I had under Cygwin / XWin, I had the same problem as in the question.

In the terminal, it worked fine, and XWin -Q also worked, so after a little digging it turned out:

 ;; 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 the early days. When I googled now, it looks like a popular setting in people's configurations. It turns out that under Windows I do not need this line for the clipboard to work correctly with Emacs (quick check with some concise diacritical characters), and under Cygwin / XWin it finally started working.

+2
source

(sorry, I have no reputation to comment, so I leave an explanation here)

  • Do you use emacs in the terminal? if so, which one (konsole, lxterm, xterm ...)?

  • Do you cut with the mouse (middle click) or keyboard?

  • Do you have a clipboard manager (e.g. glipper)?

+1
source

Do you get the same behavior if you start without an initialization file ( ~/.emacs ), i.e. with emacs -Q ?

If you can come up with a reproducible recipe starting with emacs -Q , then if you don't get some of the solution suggested here, consider sending an Emacs error Mx report-emacs-bug : Mx report-emacs-bug .

0
source

Source: https://habr.com/ru/post/912114/


All Articles