Unicode chars between Emacs/X11 cygwin and Win32

I’m using Emacs/X11 on cygwin as my main editor (when stuck on work’s machine) and Emacs 22’s Unicode support really rocks.  However, getting it to pass unicode between the kill ring and Windows /X11 clipboard doesn’t work out-of-the-box (mainly because Emacs thinks it’s on a Unix host).  The fix is easy though:

Set your MULE selection coding system to use the same unicode coding system that Windows employs
(UTF-16BE I think. Or it could be UTF-16LE, will need more trial and error)

How?  Use MULE’s set-selection-coding-system function (interactively, it’s bound to C-x RET x).  You could put this in your .emacs:

(set-selection-coding-system utf-16be-dos)

Once you’ve done this, then cut/paste of unicode works wonderfully, and you can wax lyrical about your Façade design patterns in your UML editor, or your web browser (like I just did: type C-x 8 , c to get a ç, and then copy/paste from emacs to firefox…)

Advertisements