Fork me on GitHub
#spacemacs
<
2019-02-11
>
reefersleep09:02:47

Is there anyone here who’s also having problems with copying nordic characters from spacemacs in MacOs?

reefersleep09:02:28

I’ve got the following in my .spacemacs:

(defun copy-from-osx ()
    (shell-command-to-string "pbpaste"))

  (defun paste-to-osx (text &optional push)
    (let ((process-connection-type nil))
      (let ((proc (start-process "pbcopy" "*Messages*" "pbcopy")))
        (process-send-string proc text)
        (process-send-eof proc))))

  (setq interprogram-cut-function 'paste-to-osx) ;; Paste from system clipboard
  (setq interprogram-paste-function 'copy-from-osx) ;; Copy to system clipboard

reefersleep10:02:07

It works great for ASCII chars, but if for example I try to yank this line: Du må få rødgrød med fløde og ærter and paste it here, it becomes: Du m√• f√• r√∏dgr√∏d med fl√∏de og √¶rter

reefersleep10:02:34

I’ve tried changing my “Coding system for X selection” to utf-8-ndf-mac”, “utf-8-hfs-mac” and a number of other options, and it seems to make no difference.