From 0e744319215aaf1c03f7d88819d5ebdd79b1a57f Mon Sep 17 00:00:00 2001 From: Torsten Hilbrich Date: Sat, 27 Aug 2011 21:06:53 +0200 Subject: Encode dictionary name before use avoid invoking concat on a nominally multibyte dictionary name, to avoid double-encoding the search term when consulting a single dictionary. Fix taken from Debian package. --- dictionary.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dictionary.el b/dictionary.el index 1240f3b..72e633d 100755 --- a/dictionary.el +++ b/dictionary.el @@ -638,7 +638,9 @@ This function knows about the special meaning of quotes (\")" "The workhorse for doing the search" (message "Searching for %s in %s" word dictionary) - (dictionary-send-command (concat "define " dictionary " \"" + (dictionary-send-command (concat "define " + (dictionary-encode-charset dictionary "") + " \"" (dictionary-encode-charset word dictionary) "\"")) @@ -862,7 +864,8 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"." (equal dictionary "!")) (dictionary-store-positions) (message "Requesting more information on %s" dictionary) - (dictionary-send-command (concat "show info " dictionary)) + (dictionary-send-command + (concat "show info " (dictionary-encode-charset dictionary ""))) (let ((reply (dictionary-read-reply-and-split))) (message nil) (if (dictionary-check-reply reply 550) @@ -951,8 +954,9 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"." (message "Lookup matching words for %s in %s using %s" word dictionary strategy) (dictionary-send-command - (concat "match " dictionary " " - strategy " \"" (dictionary-encode-charset word "") "\"")) + (concat "match " (dictionary-encode-charset dictionary "") " " + (dictionary-encode-charset strategy "") " \"" + (dictionary-encode-charset word "") "\"")) (let ((reply (dictionary-read-reply-and-split))) (message nil) (if (dictionary-check-reply reply 550) -- cgit v1.2.3