(let ((file-buffer (create-file-buffer filename)))
(save-excursion
(set-buffer file-buffer)
- (let ((require-final-newline nil))
+ (let ((require-final-newline nil)
+ (coding-system-for-write 'binary))
(gnus-write-buffer filename)))
(kill-buffer file-buffer))
(error "Output file does not exist")))
;; Decide whether to append to a file or to an Emacs buffer.
(let ((outbuf (get-file-buffer filename)))
(if (not outbuf)
- (let ((buffer-read-only nil))
+ (let ((buffer-read-only nil)
+ (coding-system-for-write 'binary))
(save-excursion
(goto-char (point-max))
(forward-char -2)