Skip to content

Instantly share code, notes, and snippets.

@sky-y
Created August 5, 2012 12:14
Show Gist options
  • Save sky-y/3264252 to your computer and use it in GitHub Desktop.
Save sky-y/3264252 to your computer and use it in GitHub Desktop.
Emacs: MacでPDFからコピーすると濁点が分離する問題を直す
;; ucs-normalize-NFC-region で濁点分離を直す
;; M-x ucs-normalize-NFC-buffer または "C-x RET u" で、
;; バッファ全体の濁点分離を直します。
;; 参考:
;; http://d.hatena.ne.jp/nakamura001/20120529/1338305696
;; http://www.sakito.com/2010/05/mac-os-x-normalization.html
(require 'ucs-normalize)
(prefer-coding-system 'utf-8-hfs)
(setq file-name-coding-system 'utf-8-hfs)
(setq locale-coding-system 'utf-8-hfs)
(defun ucs-normalize-NFC-buffer ()
(interactive)
(ucs-normalize-NFC-region (point-min) (point-max))
)
(global-set-key (kbd "C-x RET u") 'ucs-normalize-NFC-buffer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment