minad / cape

🦸cape.el - Completion At Point Extensions
GNU General Public License v3.0
584 stars 20 forks source link

Accented words in capt-dict #26

Closed xlzmath closed 2 years ago

xlzmath commented 2 years ago

If the dictionary file cape--dict-words contains accented letters, then insert-file-contents-literally will not decode correctly the words, resulting \238 instead of é (for example).

Using the insert-file-contents instead of insert-file-contents-literally in the definition of the function cape--dict-words can solve this problem, as this version detect the correct encoding automatically. (Not sure if it may cause other problems, at least accented letters are completed correctly after this tiny change).

(defun cape--dict-words () "Dictionary words." (or cape--dict-words (setq cape--dict-words (split-string (with-temp-buffer (insert-file-contents cape-dict-file) (buffer-string)) "\n" 'omit-nulls))))

minad commented 2 years ago

Thanks for the report!