aidan  committed ca94422

Write FCCs to Unix mailboxes using the binary coding system, not the default

  • Participants
  • Parent commits 1972e40

Comments (0)

Files changed (2)

+2005-04-02  Aidan Kehoe  <>
+	* sendmail.el (mail-do-fcc): Write the Unix mail file using the
+	binary coding system, as is appropriate for a file where non-ASCII
+	characters are encoded using separate MIME character sets for
+	every message, and thus no other single Mule coding system is
+	appropriate.
 2005-03-09  Norbert Koch  <>
 	* Makefile (VERSION): XEmacs package 1.72 released.
 		    (insert "\n\C-_")
 		    (write-region (point-min) (point-max) (car fcc-list) t)
-	      (write-region
-	       (1+ (point-min)) (point-max) (car fcc-list) t)))
+	      ;; MIME processing should have eliminated any characters
+	      ;; outside the range 0-255; if MIME processing hasn't been
+	      ;; done, there's no reasonable expectation that the data will
+	      ;; be preserved in a Unix mailbox, so we just write tildes for
+	      ;; those chars. We set the coding system for write to 'binary
+	      ;; to prevent any double-encoding that may occur if
+	      ;; buffer-file-coding-system has been initialised to a
+	      ;; non-binary-compatible coding system like, say, UTF-8.
+	      (let ((coding-system-for-write 'binary))
+		(write-region (1+ (point-min)) (point-max) (car fcc-list) t))))
 	  (and buffer (not dont-write-the-file)
 	       (with-current-buffer buffer