(epa-verify-region): Decode the plaintext by
authorueno <ueno>
Fri, 31 Aug 2007 05:36:22 +0000 (05:36 +0000)
committerueno <ueno>
Fri, 31 Aug 2007 05:36:22 +0000 (05:36 +0000)
coding-system-for-read or one which can be saved in
epa-coding-system-used.

ChangeLog
epa.el

index 8e4cff8..78fb3b2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-08-31  Daiki Ueno  <ueno@unixuser.org>
+
+       * epa.el (epa-verify-region): Decode the plaintext by
+       coding-system-for-read or one which can be saved in
+       epa-coding-system-used.
+
 2007-08-02  Adrian Aichner  <adrian@xemacs.org> (tiny change)
 
        * epa.el (epa-validity-high): Fix load error by adding missing
diff --git a/epa.el b/epa.el
index de99999..5442f23 100644 (file)
--- a/epa.el
+++ b/epa.el
@@ -858,23 +858,28 @@ Don't use this command in Lisp programs!"
     (epg-context-set-progress-callback context
                                       #'epa-progress-callback-function
                                       "Verifying...")
+    (message "Verifying...")
     (setq plain (epg-verify-string
                 context
                 (epa--encode-coding-string
                  (buffer-substring start end)
                  (or coding-system-for-write
-                     (get-text-property start
-                                        'epa-coding-system-used)))))
+                     (get-text-property start 'epa-coding-system-used)))))
+    (message "Verifying...done")
+    (setq plain (epa--decode-coding-string
+                plain
+                (or coding-system-for-read
+                    (get-text-property start 'epa-coding-system-used))))
     (if (y-or-n-p "Replace the original text? ")
        (let ((inhibit-read-only t)
              buffer-read-only)
          (delete-region start end)
          (goto-char start)
          (insert plain))
-       (with-output-to-temp-buffer "*Temp*"
-         (set-buffer standard-output)
-         (insert plain)
-         (epa-info-mode)))
+      (with-output-to-temp-buffer "*Temp*"
+       (set-buffer standard-output)
+       (insert plain)
+       (epa-info-mode)))
     (if (epg-context-result-for context 'verify)
        (epa-display-info (epg-verify-result-to-string
                           (epg-context-result-for context 'verify))))))