diff lisp/gnus/uudecode.el @ 75555:d276dce1561f

Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 197-199) - Merge from emacs--devo--0 - Update from CVS 2007-01-28 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de> * lisp/gnus/nnslashdot.el (nnslashdot-request-article): Update end-of-article regexp. 2007-01-24 Katsumi Yamaoka <yamaoka@jpl.org> * lisp/gnus/uudecode.el (uudecode-string-to-multibyte): New function emulating string-to-multibyte. (uudecode-decode-region-internal): Use it. 2007-01-28 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de> * man/gnus.texi (Batching Agents): Fix example. Reported by Tassilo Horn <tassilo@member.fsf.org>. Revision: emacs@sv.gnu.org/emacs--devo--0--patch-621
author Miles Bader <miles@gnu.org>
date Tue, 30 Jan 2007 22:18:03 +0000
parents e3694f1cb928
children 24202b793a08 f83d17e1ace6
line wrap: on
line diff
--- a/lisp/gnus/uudecode.el	Tue Jan 30 22:07:12 2007 +0000
+++ b/lisp/gnus/uudecode.el	Tue Jan 30 22:18:03 2007 +0000
@@ -128,6 +128,20 @@
 	  (message "Can not uudecode")))
       (ignore-errors (or file-name (delete-file tempfile))))))
 
+(eval-and-compile
+  (defalias 'uudecode-string-to-multibyte
+    (cond
+     ((featurep 'xemacs)
+      'identity)
+     ((fboundp 'string-to-multibyte)
+      'string-to-multibyte)
+     (t
+      (lambda (string)
+	"Return a multibyte string with the same individual chars as string."
+	(mapconcat
+	 (lambda (ch) (string-as-multibyte (char-to-string ch)))
+	 string ""))))))
+
 ;;;###autoload
 (defun uudecode-decode-region-internal (start end &optional file-name)
   "Uudecode region between START and END without using an external program.
@@ -206,7 +220,7 @@
 	  (or (markerp end) (setq end (set-marker (make-marker) end)))
 	  (goto-char start)
 	  (if enable-multibyte-characters
-	      (mapc #'(lambda (x) (insert (string-to-multibyte x)))
+	      (mapc #'(lambda (x) (insert (uudecode-string-to-multibyte x)))
 		    (nreverse result))
 	    (insert (apply 'concat (nreverse result))))
 	  (delete-region (point) end))))))