decode-coding-string if it is not bound.
* epa-file.el (epa-file--encode-coding-string): New alias.
(epa-file--decode-coding-string): New alias.
(epa-file-write-region): Use epa-file--encode-coding-string.
(epa-file-decode-and-insert): Use epa-file--decode-coding-string.
* epa.el (epa--encode-coding-string): New alias.
(epa--decode-coding-string): New alias.
(epa-verify-region): Use epa--encode-coding-string.
(epa-sign-region): Ditto; use epa--decode-coding-string.
(epa-encrypt-region): Ditto.
* epg.el (epg--encode-coding-string): New alias.
(epg--status-GET_HIDDEN): use it.
+2006-12-11  Daiki Ueno  <ueno@unixuser.org>
+
+       * pgg-epg.el (pgg-epg-decrypt-region): Don't call
+       decode-coding-string if it is not bound.
+
+       * epa-file.el (epa-file--encode-coding-string): New alias.
+       (epa-file--decode-coding-string): New alias.
+       (epa-file-write-region): Use epa-file--encode-coding-string.
+       (epa-file-decode-and-insert): Use epa-file--decode-coding-string.
+
+       * epa.el (epa--encode-coding-string): New alias.
+       (epa--decode-coding-string): New alias.
+       (epa-verify-region): Use epa--encode-coding-string.
+       (epa-sign-region): Ditto; use epa--decode-coding-string.
+       (epa-encrypt-region): Ditto.
+
+       * epg.el (epg--encode-coding-string): New alias.
+       (epg--status-GET_HIDDEN): use it.
+
 2006-11-29  Daiki Ueno  <ueno@unixuser.org>
 
        * EasyPG: Version 0.0.8 released.
 
 
 (defvar epa-file-passphrase-alist nil)
 
+(if (fboundp 'encode-coding-string)
+    (defalias 'epa-file--encode-coding-string 'encode-coding-string)
+  (defalias 'epa-file--encode-coding-string 'identity))
+
+(if (fboundp 'decode-coding-string)
+    (defalias 'epa-file--decode-coding-string 'decode-coding-string)
+  (defalias 'epa-file--decode-coding-string 'identity))
+
 (defun epa-file-passphrase-callback-function (context key-id file)
   (if (and epa-file-cache-passphrase-for-symmetric-encryption
           (eq key-id 'SYM))
           (point-min) (point-max)
           (substring file 0 (string-match epa-file-name-regexp file))
           visit beg end replace)))
-    (insert (decode-coding-string string (or coding-system-for-read
-                                            'undecided)))))
+    (insert (epa-file--decode-coding-string string (or coding-system-for-read
+                                                      'undecided)))))
 
 (defvar last-coding-system-used)
 (defun epa-file-insert-file-contents (file &optional visit beg end replace)
              (epg-encrypt-string
               context
               (if (stringp start)
-                  (encode-coding-string start coding-system)
-                (encode-coding-string (buffer-substring start end)
-                                      coding-system))
+                  (epa-file--encode-coding-string start coding-system)
+                (epa-file--encode-coding-string (buffer-substring start end)
+                                                coding-system))
               (unless (assoc file epa-file-passphrase-alist)
                 (epa-select-keys
                  context
 
          (epg-sub-key-id (car (epg-key-sub-key-list
                                (widget-get widget :value))))))
 
+(if (fboundp 'encode-coding-string)
+    (defalias 'epa--encode-coding-string 'encode-coding-string)
+  (defalias 'epa--encode-coding-string 'identity))
+
+(if (fboundp 'decode-coding-string)
+    (defalias 'epa--decode-coding-string 'decode-coding-string)
+  (defalias 'epa--decode-coding-string 'identity))
+
 (defun epa-keys-mode ()
   "Major mode for `epa-list-keys'."
   (kill-all-local-variables)
       (message "Decrypting...done")
       (delete-region start end)
       (goto-char start)
-      (insert (decode-coding-string plain coding-system-for-read))
+      (insert (epg--decode-coding-string plain coding-system-for-read))
       (if (epg-context-result-for context 'verify)
          (epa-display-info (epg-verify-result-to-string
                             (epg-context-result-for context 'verify)))))))
     (epg-context-set-progress-callback context
                                       #'epa-progress-callback-function)
     (epg-verify-string context
-                      (encode-coding-string
+                      (epa--encode-coding-string
                        (buffer-substring start end)
                        coding-system-for-write))
     (if (epg-context-result-for context 'verify)
                                         #'epa-progress-callback-function)
       (message "Signing...")
       (setq signature (epg-sign-string context
-                                      (encode-coding-string
+                                      (epa--encode-coding-string
                                        (buffer-substring start end)
                                        coding-system-for-write)
                                       mode))
       (message "Signing...done")
       (delete-region start end)
-      (insert (decode-coding-string signature coding-system-for-read)))))
+      (insert (epg--decode-coding-string signature coding-system-for-read)))))
 
 ;;;###autoload
 (defun epa-encrypt-region (start end recipients)
                                         #'epa-progress-callback-function)
       (message "Encrypting...")
       (setq cipher (epg-encrypt-string context
-                                      (encode-coding-string
+                                      (epa--encode-coding-string
                                        (buffer-substring start end)
                                        coding-system-for-write)
                                       recipients))
 
                  (if epg-passphrase-coding-system
                      (progn
                        (setq encoded-passphrase-with-new-line
-                             (encode-coding-string
+                             (epg--encode-coding-string
                               passphrase-with-new-line
                               (coding-system-change-eol-conversion
                                epg-passphrase-coding-system 'unix)))
   (defun epg--clear-string (string)
     (fillarray string 0)))
 
+(if (fboundp 'encode-coding-string)
+    (defalias 'epg--encode-coding-string 'encode-coding-string)
+  (defalias 'epg--encode-coding-string 'identity))
+
 (defun epg--args-from-sig-notations (notations)
   (apply #'nconc
         (mapcar
 
         (pgg-remove-passphrase-from-cache (car pgg-epg-secret-key-id-list))
         (setq pgg-epg-secret-key-id-list (cdr pgg-epg-secret-key-id-list)))
        (signal (car error) (cdr error))))
-    (if pgg-text-mode
+    (if (and pgg-text-mode
+            (fboundp 'decode-coding-string))
        (setq plain (decode-coding-string plain 'raw-text)))
     (save-excursion
       (set-buffer (get-buffer-create pgg-output-buffer))