(defun dictionary-dictionaries ()
"Return the list of dictionaries the server supports."
(dictionary-send-command "show db")
- (when (and (= (read (dictionary-read-reply)) 110))
+ (when (= (read (dictionary-read-reply)) 110)
(with-temp-buffer
- (insert (dictionary-read-answer))
+ (insert (decode-coding-string (dictionary-read-answer) 'utf-8))
(goto-char (point-min))
(let ((result '(("!" . "First matching dictionary")
("*" . "All dictionaries"))))
(defun dictionary-completing-read-dictionary ()
"Prompt for a dictionary the server supports."
(let* ((dicts (dictionary-dictionaries))
- (len (apply #'max (mapcar #'length (mapcar #'car dicts))))
+ (len (apply #'max (mapcar #'string-width (mapcar #'car dicts))))
(completion-extra-properties
(list :annotation-function
(lambda (key)