From 6e6f95570bf255794292d50a7be005db2944de5b Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 19 Apr 2021 12:32:21 -0500 Subject: Fix clipboard pasting non-ASCII characters ... at least on Windows. Solution found here: https://emacs.stackexchange.com/questions/22727/pasting-text-from-clipboard-why-m-instead-of-linebreaks Other resources: https://emacs.stackexchange.com/questions/22727/pasting-text-from-clipboard-why-m-instead-of-linebreaks https://goyoambrosio.com/2018/06/Dealing-with-utf-8-in-Emacs/ --- init.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index febe047..d7829c3 100644 --- a/init.el +++ b/init.el @@ -105,7 +105,7 @@ (delete-selection-mode +1) ;; Encoding - (:option local-coding-system 'utf-8-unix + (:option locale-coding-system 'utf-8-unix coding-system-for-read 'utf-8-unix coding-system-for-write 'utf-8-unix buffer-file-coding-system 'utf-8-unix @@ -121,8 +121,13 @@ (set-default-coding-systems 'utf-8-unix) (set-terminal-coding-system 'utf-8-unix) (set-keyboard-coding-system 'utf-8-unix) - (set-selection-coding-system 'utf-8-unix) + (pcase acdw/system + (:work (set-clipboard-coding-system 'utf-16-le) + (set-selection-coding-system 'utf-16-le)) + (_ (set-selection-coding-system 'utf-8) + (set-clipboard-coding-system 'utf-8))) + ;; Cursor (:option cursor-type 'bar cursor-in-non-selected-windows 'hollow -- cgit 1.4.1-21-gabe81