Instantly share code, notes, and snippets.

Embed
What would you like to do?
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