Friday, July 12, 2019

fix character encoding for utf-8 (elisp)

(let ((chars '(("ú" . "ú")
               ("á" . "á")
               ("í" . "í")
               ("ó" . "ó")
               ("é" . "é"))))
  (dolist (char chars)
    (save-excursion
      (goto-char (point-min))
      (while (search-forward (car char) nil t)
        (replace-match (cdr char) t)))))

No comments:

Post a Comment