diff options
author | Torsten Hilbrich <torsten.hilbrich@gmx.net> | 2011-08-27 21:06:53 +0200 |
---|---|---|
committer | Torsten Hilbrich <torsten.hilbrich@gmx.net> | 2011-08-27 21:06:53 +0200 |
commit | 0e744319215aaf1c03f7d88819d5ebdd79b1a57f (patch) | |
tree | 2a5f1933a461723b8eaf1fb651a210b8dc297fa7 | |
parent | d21375929c86079424cfbdee97854fb3e1640b7b (diff) |
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.
-rwxr-xr-x | dictionary.el | 12 |
1 files 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) |