- (as-binary-process
- (apply (function call-process-region)
- start end (car uuencode-external-decoder)
- t nil nil (cdr uuencode-external-decoder))
- (as-binary-input-file (insert-file-contents filename))
- ;; The previous line causes the buffer to be made read-only, I
- ;; do not pretend to understand the control flow leading to this
- ;; but suspect it has something to do with image-mode. -slb
- ;; Use `inhibit-read-only' to avoid to force
- ;; buffer-read-only nil. - tomo.
- (let ((inhibit-read-only t))
- (delete-file filename)
- )
- ))
- )))
-
-(defalias 'uuencode-encode-region 'uuencode-external-encode-region)
-(defalias 'uuencode-decode-region 'uuencode-external-decode-region)
+ (let ((coding-system-for-read 'binary)
+ (coding-system-for-write 'binary))
+ (apply (function call-process-region)
+ start end (car uuencode-external-decoder)
+ t nil nil
+ (cdr uuencode-external-decoder))
+ (insert-file-contents filename)
+ ;; The previous line causes the buffer to be made read-only, I
+ ;; do not pretend to understand the control flow leading to this
+ ;; but suspect it has something to do with image-mode. -slb
+ ;; Use `inhibit-read-only' to avoid to force
+ ;; buffer-read-only nil. - tomo.
+ (let ((inhibit-read-only t))
+ (delete-file filename)))))))
+
+(mel-define-method-function (mime-encode-region start end (nil "x-uue"))
+ 'uuencode-external-encode-region)
+(mel-define-method-function (mime-decode-region start end (nil "x-uue"))
+ 'uuencode-external-decode-region)
+
+
+;;; @ encoder/decoder for string
+;;;
+
+(mel-define-method mime-encode-string (string (nil "x-uue"))
+ (with-temp-buffer
+ (insert string)
+ (uuencode-external-encode-region (point-min)(point-max))
+ (buffer-string)))
+
+(mel-define-method mime-decode-string (string (nil "x-uue"))
+ (with-temp-buffer
+ (insert string)
+ (uuencode-external-decode-region (point-min)(point-max))
+ (buffer-string)))